Created
November 28, 2016 19:52
-
-
Save ek-nath/809ae48e59f918fe74261a67e3ce9a2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <moderngpu/transform.hxx> | |
using namespace mgpu; | |
int main(int argc, char** argv) { | |
// The context encapsulates things like an allocator and a stream. | |
// By default it prints device info to the console. | |
standard_context_t context; | |
// Launch five threads to greet us. | |
transform([]MGPU_DEVICE(int index) { | |
printf("Hello GPU from thread %d\n", index); | |
}, 5, context); | |
// Synchronize on the context's stream to send the output to the console. | |
context.synchronize(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment