Skip to content

Commit 7984192

Browse files
committed
[HIP] Adapt array.cu test to HIP
1 parent 44cbac9 commit 7984192

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

External/HIP/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ macro(create_local_hip_tests VariantSuffix)
2222
list(APPEND HIP_LOCAL_TESTS saxpy)
2323
list(APPEND HIP_LOCAL_TESTS memmove)
2424
list(APPEND HIP_LOCAL_TESTS split-kernel-args)
25+
list(APPEND HIP_LOCAL_TESTS array)
2526

2627
# TODO: Re-enable InOneWeekend after it is fixed
2728
#list(APPEND HIP_LOCAL_TESTS InOneWeekend)

External/HIP/array.hip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "cuda2hip.h"
2+
#include "../CUDA/array.cu"

External/HIP/array.reference_output

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Success!
2+
exit 0

External/HIP/cuda2hip.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef CUDA_2_HIP
2+
#define CUDA_2_HIP
3+
4+
#include "hip/hip_runtime.h"
5+
6+
#define cudaError_t hipError_t
7+
#define cudaSuccess hipSuccess
8+
#define cudaDeviceSynchronize hipDeviceSynchronize
9+
10+
#endif

0 commit comments

Comments
 (0)