mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 13:27:29 -04:00
Added vx_tempelate.c
This commit is contained in:
parent
1db160a289
commit
cb3e2da584
1 changed files with 42 additions and 0 deletions
42
runtime/vx_tempelate.c
Normal file
42
runtime/vx_tempelate.c
Normal 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);
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue