From 2cca22787ef4b574953571dd81a67eef9a7f2907 Mon Sep 17 00:00:00 2001 From: akashk4 <akashk4@illinois.edu> Date: Fri, 3 Jan 2020 03:03:55 -0600 Subject: [PATCH] Pipeline intrinsics with root arguments allocated on stack --- .../hpvm/test/unitTests/PipelineIntrinsics.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 llvm/tools/hpvm/test/unitTests/PipelineIntrinsics.c diff --git a/llvm/tools/hpvm/test/unitTests/PipelineIntrinsics.c b/llvm/tools/hpvm/test/unitTests/PipelineIntrinsics.c new file mode 100644 index 0000000000..0c19321292 --- /dev/null +++ b/llvm/tools/hpvm/test/unitTests/PipelineIntrinsics.c @@ -0,0 +1,35 @@ +#include <stdlib.h> +#include "visc.h" + +struct Root { + int *input; + int *output; +}; + +void PipeRoot(int *In, int *Out) { + __visc__hint (CPU_TARGET); + __visc__attributes(1, In, 1, Out); + __visc__return(1, Out); +} + +int main(void) { + int In, Out; + + // struct Root RootArgs; + // RootArgs.input = (int *)&In; + // RootArgs.output = (int *)&Out; + + struct Root* RootArgs = (struct Root *) malloc(sizeof(struct Root)); + RootArgs->input = (int *)&In; + RootArgs->output = (int *)&Out; + + __visc__init(); + + void* PipeDFG = __visc__launch(0, PipeRoot, (void *) RootArgs); + __visc__wait(PipeDFG); + + __visc__cleanup(); + + return 0; +} + -- GitLab