Skip to content
Snippets Groups Projects
Commit 9a30780c authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Adding __visc_node_id intrinsic - untested

parent de2a54ad
No related branches found
No related tags found
No related merge requests found
......@@ -325,4 +325,7 @@ let TargetPrefix = "visc" in {
llvm_i32_ty,
llvm_i32_ty], []>;
def int_visc_node_id : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty], []>;
}
......@@ -178,6 +178,9 @@ IS_VISC_CALL(tensor_tanh)
IS_VISC_CALL(tensor_sigmoid)
IS_VISC_CALL(tensor_softmax)
IS_VISC_CALL(node_id)
// Return the constant integer represented by value V
static unsigned getNumericValue(Value* V) {
assert(isa<ConstantInt>(V)
......@@ -1308,6 +1311,12 @@ bool GenVISC::runOnModule(Module &M) {
if (isVISCCall_tensor_softmax(I)) {
ReplaceCallWithIntrinsic(I, Intrinsic::visc_tensor_softmax, &toBeErased);
}
// New Intrinsic to set Node ID
if (isVISCCall_node_id(I)) {
ReplaceCallWithIntrinsic(I, Intrinsic::visc_node_id, &toBeErased);
}
}
// Erase the __visc__node calls
......
......@@ -112,6 +112,10 @@ void* __visc__tensor_map3(void*, void*, void*, void*);
void* __visc__tensor_cosineT(void*);
void* __visc__tensor_stencil(void*);
// New HPVM intrinsic for Setting Node ID
void* __visc__node_id(int);
#include <unistd.h>
long get_global_id(int);
......
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