Files
rocm-systems/tests/hipify-clang/unit_tests/samples/allocators.cu
T
Evgeny Mankov fbfe005e4e [HIPIFY] Introduce CUDA installation path option '-cuda-path'
Repeats clang's '--cuda-path' option.

[Reason]
In case of absence of any other clang's options setting '-cuda-path' allows not to specify separator '--' before clang's '--cuda-path'.

+ Tests and scripts are updated accordingly.
2019-01-09 20:18:36 +03:00

19 строки
357 B
Plaintext

// RUN: %run_test hipify "%s" "%t" %hipify_args %clang_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;
}