From a73beaf73f4e900fc82cd8d5b1a288a9f938ee86 Mon Sep 17 00:00:00 2001 From: Satyanvesh Dittakavi Date: Mon, 22 Feb 2021 06:26:01 +0000 Subject: [PATCH] SWDEV-272082 - Fix Cooperative groups tests on HIP CUDA path Change-Id: Icc68bc1e48c01ee120aaab17c928ffbbb96eae96 [ROCm/hip commit: 4985aa5e5ca9013b455b863945323e4de1ec101b] --- .../src/runtimeApi/cooperativeGrps/cooperative_streams.cpp | 2 +- .../src/runtimeApi/cooperativeGrps/hipCGThreadBlockType.cpp | 4 ++-- .../cooperativeGrps/hipCGThreadBlockTypeViaBaseType.cpp | 4 ++-- .../cooperativeGrps/hipCGThreadBlockTypeViaPublicApi.cpp | 4 ++-- .../runtimeApi/cooperativeGrps/hipLaunchCoopMultiKernel.cpp | 2 +- .../cooperativeGrps/multi_gpu_api_failure_tests.cpp | 3 ++- .../src/runtimeApi/cooperativeGrps/multi_gpu_streams.cpp | 2 +- .../runtimeApi/cooperativeGrps/multi_grid_group_all_gpus.cpp | 2 +- .../cooperativeGrps/simple_multi_grid_group_barrier.cpp | 2 +- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp index c9adc03b24..f79db68368 100644 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp @@ -50,7 +50,7 @@ regular kernels can properly run in parallel with cooperative kernels. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvidia * TEST: %t * HIT_END */ diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockType.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockType.cpp index 0956fc94db..7729f217f8 100755 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockType.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockType.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. /* HIT_START * BUILD: %t %s ../../test_common.cpp - * TEST: %t EXCLUDE_HIP_PLATFORM nvidia + * TEST: %t * HIT_END */ @@ -164,7 +164,7 @@ int main() } // Test block sizes which are powers of 2 - int i = 0; + int i = 1; while (true) { int blockSize = pow(2, i); if (blockSize > maxThreadsPerBlock) diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockTypeViaBaseType.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockTypeViaBaseType.cpp index f9dba1cf89..f8e0a90759 100755 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockTypeViaBaseType.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockTypeViaBaseType.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. /* HIT_START * BUILD: %t %s ../../test_common.cpp - * TEST: %t EXCLUDE_HIP_PLATFORM nvidia + * TEST: %t * HIT_END */ @@ -133,7 +133,7 @@ int main() } // Test block sizes which are powers of 2 - int i = 0; + int i = 1; while (true) { int blockSize = pow(2, i); if (blockSize > maxThreadsPerBlock) diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockTypeViaPublicApi.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockTypeViaPublicApi.cpp index 9b626e9f31..3fe6d97976 100755 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockTypeViaPublicApi.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipCGThreadBlockTypeViaPublicApi.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. /* HIT_START * BUILD: %t %s ../../test_common.cpp - * TEST: %t EXCLUDE_HIP_PLATFORM nvidia + * TEST: %t * HIT_END */ @@ -133,7 +133,7 @@ int main() } // Test block sizes which are powers of 2 - int i = 0; + int i = 1; while (true) { int blockSize = pow(2, i); if (blockSize > maxThreadsPerBlock) diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipLaunchCoopMultiKernel.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipLaunchCoopMultiKernel.cpp index 0e523f9d2e..171838eb11 100644 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipLaunchCoopMultiKernel.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/hipLaunchCoopMultiKernel.cpp @@ -20,7 +20,7 @@ THE SOFTWARE. // Simple test for hipLaunchCooperativeKernelMultiDevice API. /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 -rdc=true -gencode arch=compute_60,code=sm_60 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 -rdc=true -gencode arch=compute_70,code=sm_70 * TEST: %t * HIT_END */ diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_gpu_api_failure_tests.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_gpu_api_failure_tests.cpp index b75725fed4..280f77975a 100644 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_gpu_api_failure_tests.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_gpu_api_failure_tests.cpp @@ -360,7 +360,7 @@ int main(int argc, char** argv) { std::cout << "hipErrorInvalidResourceHandle" << std::endl; } HIPCHECK(hipDeviceSynchronize()); - +#ifndef __HIP_PLATFORM_NVIDIA__ std::cout << "Launching a multi-GPU cooperative kernel with two "; std::cout << "different kernels." << std::endl; bool supports_sep_kernels = true; @@ -551,6 +551,7 @@ int main(int argc, char** argv) { std::cout << "\tProperly launched." << std::endl; HIPCHECK(hipDeviceSynchronize()); +#endif for (int m = 0; m < 2; ++m) { HIPCHECK(hipFree(good_dev_array[m])); HIPCHECK(hipFree(bad_dev_array[m])); diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_gpu_streams.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_gpu_streams.cpp index a0275d7ba5..671b8f1af0 100644 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_gpu_streams.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_gpu_streams.cpp @@ -80,7 +80,7 @@ overlap-allowing flags work as expected. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 -rdc=true -gencode arch=compute_60,code=sm_60 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 -rdc=true -gencode arch=compute_70,code=sm_70 * TEST: %t * HIT_END */ diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_grid_group_all_gpus.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_grid_group_all_gpus.cpp index f2f9814dba..2d6d3bffbc 100644 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_grid_group_all_gpus.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/multi_grid_group_all_gpus.cpp @@ -40,7 +40,7 @@ will sleep on the barrier waiting for the last warp to finally catch up. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -rdc=true -gencode arch=compute_60,code=sm_60 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -rdc=true -gencode arch=compute_70,code=sm_70 * TEST: %t * HIT_END */ diff --git a/projects/hip/tests/src/runtimeApi/cooperativeGrps/simple_multi_grid_group_barrier.cpp b/projects/hip/tests/src/runtimeApi/cooperativeGrps/simple_multi_grid_group_barrier.cpp index 14fc809bff..292df51d10 100644 --- a/projects/hip/tests/src/runtimeApi/cooperativeGrps/simple_multi_grid_group_barrier.cpp +++ b/projects/hip/tests/src/runtimeApi/cooperativeGrps/simple_multi_grid_group_barrier.cpp @@ -40,7 +40,7 @@ will sleep on the barrier waiting for the last warp to finally catch up. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -rdc=true -gencode arch=compute_60,code=sm_60 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -rdc=true -gencode arch=compute_70,code=sm_70 * TEST: %t * HIT_END */