Add a test that exposes #260

[ROCm/clr commit: 0afc6b2e95]
This commit is contained in:
Chris Kitching
2017-11-11 11:00:40 +00:00
parent 5ced4544eb
commit 41d7a05974
@@ -0,0 +1,18 @@
// RUN: %run_test hipify "%s" "%t" %cuda_args
#pragma once
#include <cuda_runtime.h>
/**
* Allocate GPU memory for `count` elements of type `T`.
*/
template<typename T>
static T* gpuMalloc(size_t count) {
T* ret = nullptr;
// CHECK: hipMalloc(&ret, count * sizeof(T));
cudaMalloc(&ret, count * sizeof(T));
return ret;
}