Added simple_main

This commit is contained in:
felsabbagh3
2019-11-07 00:10:06 -05:00
parent bf43680b7c
commit 9e2de897f0
19 changed files with 2524 additions and 290 deletions

View File

@@ -0,0 +1,42 @@
#include "io/io.h" // Printing functions
#include "intrinsics/instrinsics.h" // vx_threadID and vx_WarpID
struct args
{
void * data;
};
void function(void * arg)
{
struct args * real_arg = (struct args *) arg;
unsigned tid = vx_threadID();
unsigned wid = vx_WarpID();
__if(something) // Control divergent if
{
}
__else
{
}
__endif
}
int main()
{
void * data = vx_loadfile("filename.txt"); // The raw char data will be returned by vx_loadfile
struct args arg;
arg.data = data;
vx_spawnWarps(numWarps, numThreads, function, &data);
}