Files
rocm-systems/projects/hip/tests/hipify-clang/allocators.cu
T
Chris Kitching 1451d8fc89 Add a test that exposes #260
[ROCm/hip commit: 9165df3848]
2017-11-13 16:18:15 +00:00

19 řádky
343 B
Plaintext

// 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;
}