From 69cbc17c3eb8f882fbe5a4c33bc709e11f956893 Mon Sep 17 00:00:00 2001 From: Aditya Avinash Atluri Date: Wed, 2 Mar 2016 08:53:10 -0600 Subject: [PATCH 1/3] Added Copyright [ROCm/hip commit: 34e81c57ffa7d312851a869f07bd41b347a7f26a] --- .../hip/tests/src/hipMultiThreadStreams2.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/projects/hip/tests/src/hipMultiThreadStreams2.cpp b/projects/hip/tests/src/hipMultiThreadStreams2.cpp index c72d087db0..8d75a12725 100644 --- a/projects/hip/tests/src/hipMultiThreadStreams2.cpp +++ b/projects/hip/tests/src/hipMultiThreadStreams2.cpp @@ -1,3 +1,25 @@ +/* +Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + #include #include"test_common.h" #include From 0ed3d943f1124788a26cb5cab80a1ed78b185d13 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Wed, 2 Mar 2016 08:08:45 -0600 Subject: [PATCH 2/3] Initialize hip when single kernel is called [ROCm/hip commit: ce7ae41d421db974441c9438528af509724626f0] --- projects/hip/src/hip_hcc.cpp | 1 + projects/hip/tests/src/hipKernel.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 projects/hip/tests/src/hipKernel.cpp diff --git a/projects/hip/src/hip_hcc.cpp b/projects/hip/src/hip_hcc.cpp index 09b4770347..1cf8745c0b 100644 --- a/projects/hip/src/hip_hcc.cpp +++ b/projects/hip/src/hip_hcc.cpp @@ -1090,6 +1090,7 @@ inline hipStream_t ihipSyncAndResolveStream(hipStream_t stream) // Allows runtime to track some information about the stream. hipStream_t ihipPreLaunchKernel(hipStream_t stream, hc::accelerator_view **av) { + std::call_once(hip_initialized, ihipInit); stream = ihipSyncAndResolveStream(stream); stream->preKernelCommand(); diff --git a/projects/hip/tests/src/hipKernel.cpp b/projects/hip/tests/src/hipKernel.cpp new file mode 100644 index 0000000000..6bf089bc4e --- /dev/null +++ b/projects/hip/tests/src/hipKernel.cpp @@ -0,0 +1,8 @@ +#include"test_common.h" + +__global__ void Empty(hipLaunchParm lp, int param){} + +int main(){ +hipLaunchKernel(HIP_KERNEL_NAME(Empty), dim3(1), dim3(1), 0, 0, 0); +hipDeviceSynchronize(); +} From ea4635eb0658ec85455e6cfa94c47620902e52ec Mon Sep 17 00:00:00 2001 From: pensun Date: Wed, 2 Mar 2016 04:35:37 -0600 Subject: [PATCH 3/3] fix for hipEnvVarDriver test [ROCm/hip commit: 4018d6a33b009620aea4ab95c0cbabdd0b353643] --- projects/hip/tests/src/hipEnvVarDriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/hip/tests/src/hipEnvVarDriver.cpp b/projects/hip/tests/src/hipEnvVarDriver.cpp index ebb1be956d..21884f00b1 100644 --- a/projects/hip/tests/src/hipEnvVarDriver.cpp +++ b/projects/hip/tests/src/hipEnvVarDriver.cpp @@ -98,6 +98,6 @@ int main() { setenv("HIP_VISIBLE_DEVICES","-100,0,1",1); assert(getDeviceNumber() == 0); - std::cout << "Passed!" << std::endl; + std::cout << "PASSED" << std::endl; return 0; }