Skip to content
Snippets Groups Projects
Commit 41f6987e authored by Akash Kothari's avatar Akash Kothari :speech_balloon:
Browse files

Added tests for create node and edge intrinsics

parent 1f9a156e
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
#include "visc.h"
struct Root {
int *input;
int *output;
};
void Func1(int *In, int *Out) {
__visc__hint (CPU_TARGET);
__visc__attributes(1, In, 1, Out);
__visc__return(1, Out);
}
void Func2(int *BindIn, int *SrcIn, int *Out) {
__visc__hint (CPU_TARGET);
__visc__attributes(2, BindIn, SrcIn, 1, Out);
__visc__return(1, Out);
}
void PipeRoot(int *In, int *Out) {
__visc__hint (CPU_TARGET);
__visc__attributes(1, In, 1, Out);
void* SrcNode = __visc__createNodeND(0, Func1);
void* DestNode = __visc__createNodeND(0, Func2);
__visc__bindIn(SrcNode, 0, 0, 0);
__visc__bindIn(DestNode, 0, 0, 0);
__visc__edge(SrcNode, DestNode, 1, 0, 1, 0);
__visc__bindOut(SrcNode, 0, 0, 0);
}
int main(void) {
int In = 1;
int Out = 0;
struct Root RootArgs = {(int *) &In, (int *) &Out};
__visc__init();
void* PipeDFG = __visc__launch(0, PipeRoot, (void *) &RootArgs);
__visc__wait(PipeDFG);
__visc__cleanup();
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment