diff --git a/projects/clr/hipamd/tests/hipify-clang/allocators.cu b/projects/clr/hipamd/tests/hipify-clang/allocators.cu new file mode 100644 index 0000000000..3f130be227 --- /dev/null +++ b/projects/clr/hipamd/tests/hipify-clang/allocators.cu @@ -0,0 +1,18 @@ +// RUN: %run_test hipify "%s" "%t" %cuda_args + +#pragma once + +#include + + +/** + * Allocate GPU memory for `count` elements of type `T`. + */ +template +static T* gpuMalloc(size_t count) { + T* ret = nullptr; + // CHECK: hipMalloc(&ret, count * sizeof(T)); + cudaMalloc(&ret, count * sizeof(T)); + return ret; +} +