Skip to content

Instantly share code, notes, and snippets.

@cronin101
Last active December 11, 2015 04:38
Show Gist options
  • Save cronin101/4546020 to your computer and use it in GitHub Desktop.
Save cronin101/4546020 to your computer and use it in GitHub Desktop.
HaDope syntax idea
gpu = HaDope::GPU.new
dataset = HaDope::Dataset.new {
type: :int,
size: 100,
data: (1..100).to_a
}
gpu.load(dataset)
add_two = HaDope::Map.new {
key: [:int, :i],
fn:
<<KERNEL
i += 1;
i += 1;
KERNEL
}
gpu.map(add_two)
greater_than_three = HaDope::Filter.new {
key: [:int, :i],
fn:
<<KERNEL
i > 3;
KERNEL
}
gpu.filter(greater_than_three)
results = gpu.perform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment