From d3ba2b978275e772e33c2094348485cb3e123de0 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Sun, 6 Mar 2016 08:31:04 -0600 Subject: [PATCH] corrected hipDeviceGetProperties to hipGetDeviceProperties - not docs --- RELEASE.md | 2 +- bin/hipify | 2 +- docs/markdown/hip_kernel_language.md | 2 +- docs/markdown/hip_porting_guide.md | 4 ++-- include/hcc_detail/hip_runtime_api.h | 4 ++-- include/nvcc_detail/hip_runtime_api.h | 2 +- samples/0_Intro/bit_extract/bit_extract.cpp | 2 +- samples/0_Intro/square/square.hipref.cpp | 2 +- samples/1_Utils/hipInfo/hipInfo.cpp | 2 +- src/hip_hcc.cpp | 2 +- tests/src/hipEnvVar.cpp | 2 +- tests/src/hipGetDeviceAttribute.cpp | 2 +- tests/src/hipHcc.cpp | 2 +- tests/src/hipHostAlloc.cpp | 2 +- tests/src/hipSimpleAtomicsTest.cpp | 2 +- tests/src/hip_anyall.cpp | 2 +- tests/src/hip_ballot.cpp | 2 +- tests/src/hip_brev.cpp | 2 +- tests/src/hip_clz.cpp | 2 +- tests/src/hip_ffs.cpp | 2 +- tests/src/hip_popc.cpp | 2 +- tests/src/test_common.cpp | 2 +- util/gedit/hip.lang | 4 ++-- util/vim/hip.vim | 2 +- 24 files changed, 27 insertions(+), 27 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index ae0a0d2b4e..055dd0a60d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -23,7 +23,7 @@ Date: 2016.02.18 - Update Runtime Documentation. - Improve implementations of cross-lane operations (_ballot, _any, _all). - Provide shuffle intrinsics (performance optimization in-progress). -- Support hipDeviceAttribute for querying "one-shot" device attributes, as an alternative to hipDeviceGetProperties. +- Support hipDeviceAttribute for querying "one-shot" device attributes, as an alternative to hipGetDeviceProperties. =================================================================================================== diff --git a/bin/hipify b/bin/hipify index 811f6ac036..8ff04030fd 100755 --- a/bin/hipify +++ b/bin/hipify @@ -350,7 +350,7 @@ while (@ARGV) { #-------- # Device $ft{'dev'} += s/\bcudaDeviceProp\b/hipDeviceProp_t/g; - $ft{'dev'} += s/\bcudaGetDeviceProperties\b/hipDeviceGetProperties/g; + $ft{'dev'} += s/\bcudaGetDeviceProperties\b/hipGetDeviceProperties/g; # Attribute $ft{'err'} += s/\bcudaDevAttrMaxThreadsPerBlock\b/hipDeviceAttributeMaxThreadsPerBlock/g; diff --git a/docs/markdown/hip_kernel_language.md b/docs/markdown/hip_kernel_language.md index 4d3e72ce65..b54cf16613 100644 --- a/docs/markdown/hip_kernel_language.md +++ b/docs/markdown/hip_kernel_language.md @@ -427,7 +427,7 @@ Nvidia devices implement the timer as a per-compute-unit clock that increments o To obtain the clock frequency, use the hipDeviceProp_t.clockInstructionRate field: ``` -hipDeviceGetProperties(&deviceProps, deviceId); +hipGetDeviceProperties(&deviceProps, deviceId); // Compute time in ms--device_ticks is based on values reported from clock() device function float time = device_ticks / (float)deviceProps.clockInstructionRate; ``` diff --git a/docs/markdown/hip_porting_guide.md b/docs/markdown/hip_porting_guide.md index f4b1f8a7e4..6376593a98 100644 --- a/docs/markdown/hip_porting_guide.md +++ b/docs/markdown/hip_porting_guide.md @@ -215,10 +215,10 @@ For host code, the `__HIP_ARCH__*` defines are set to 0. You should only use the ### Device-Architecture Properties -Host code should query the architecture feature flags in the device properties that hipDeviceGetProperties returns, rather than testing the "major" and "minor" fields directly: +Host code should query the architecture feature flags in the device properties that hipGetDeviceProperties returns, rather than testing the "major" and "minor" fields directly: ``` -hipDeviceGetProperties(&deviceProp, device); +hipGetDeviceProperties(&deviceProp, device); //if ((deviceProp.major == 1 && deviceProp.minor < 2)) // non-portable if (deviceProp.arch.hasSharedInt32Atomics) { // portable HIP feature query // has shared int32 atomic operations ... diff --git a/include/hcc_detail/hip_runtime_api.h b/include/hcc_detail/hip_runtime_api.h index fff6107d6b..1588f73a5a 100644 --- a/include/hcc_detail/hip_runtime_api.h +++ b/include/hcc_detail/hip_runtime_api.h @@ -252,9 +252,9 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) * @param [out] prop written with device properties * @param [in] device which device to query for information * - * Populates hipDeviceGetProperties with information for the specified device. + * Populates hipGetDeviceProperties with information for the specified device. */ -hipError_t hipDeviceGetProperties(hipDeviceProp_t* prop, int device); +hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int device); diff --git a/include/nvcc_detail/hip_runtime_api.h b/include/nvcc_detail/hip_runtime_api.h index 1d99ba28f2..98e7ca004c 100644 --- a/include/nvcc_detail/hip_runtime_api.h +++ b/include/nvcc_detail/hip_runtime_api.h @@ -167,7 +167,7 @@ inline static hipError_t hipMemset(void* devPtr,int value, size_t count) { return hipCUDAErrorTohipError(cudaMemset(devPtr, value, count)); } -inline static hipError_t hipDeviceGetProperties(hipDeviceProp_t *p_prop, int device) +inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t *p_prop, int device) { cudaDeviceProp cdprop; cudaError_t cerror; diff --git a/samples/0_Intro/bit_extract/bit_extract.cpp b/samples/0_Intro/bit_extract/bit_extract.cpp index d32b65c15d..14b5be66d4 100644 --- a/samples/0_Intro/bit_extract/bit_extract.cpp +++ b/samples/0_Intro/bit_extract/bit_extract.cpp @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) int deviceId; CHECK (hipGetDevice(&deviceId)); hipDeviceProp_t props; - CHECK(hipDeviceGetProperties(&props, deviceId)); + CHECK(hipGetDeviceProperties(&props, deviceId)); printf ("info: running on device #%d %s\n", deviceId, props.name); diff --git a/samples/0_Intro/square/square.hipref.cpp b/samples/0_Intro/square/square.hipref.cpp index ed2a938279..5d53a8d584 100644 --- a/samples/0_Intro/square/square.hipref.cpp +++ b/samples/0_Intro/square/square.hipref.cpp @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) size_t Nbytes = N * sizeof(float); hipDeviceProp_t props; - CHECK(hipDeviceGetProperties(&props, 0/*deviceID*/)); + CHECK(hipGetDeviceProperties(&props, 0/*deviceID*/)); printf ("info: running on device %s\n", props.name); printf ("info: allocate host mem (%6.2f MB)\n", 2*Nbytes/1024.0/1024.0); diff --git a/samples/1_Utils/hipInfo/hipInfo.cpp b/samples/1_Utils/hipInfo/hipInfo.cpp index 824ab17d37..146d17e015 100644 --- a/samples/1_Utils/hipInfo/hipInfo.cpp +++ b/samples/1_Utils/hipInfo/hipInfo.cpp @@ -73,7 +73,7 @@ void printDeviceProp (int deviceId) cout << setw(w1) << "device#" << deviceId << endl; hipDeviceProp_t props; - HIPCHECK(hipDeviceGetProperties(&props, deviceId)); + HIPCHECK(hipGetDeviceProperties(&props, deviceId)); cout << setw(w1) << "Name: " << props.name << endl; cout << setw(w1) << "pciBusID: " << props.pciBusID << endl; diff --git a/src/hip_hcc.cpp b/src/hip_hcc.cpp index b09f622b70..e453fc2069 100644 --- a/src/hip_hcc.cpp +++ b/src/hip_hcc.cpp @@ -1380,7 +1380,7 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) * @bug HCC always returns 0 for regsPerBlock * @bug HCC always returns 0 for l2CacheSize */ -hipError_t hipDeviceGetProperties(hipDeviceProp_t* props, int device) +hipError_t hipGetDeviceProperties(hipDeviceProp_t* props, int device) { std::call_once(hip_initialized, ihipInit); diff --git a/tests/src/hipEnvVar.cpp b/tests/src/hipEnvVar.cpp index c1b6589fe2..229fa390c2 100644 --- a/tests/src/hipEnvVar.cpp +++ b/tests/src/hipEnvVar.cpp @@ -108,7 +108,7 @@ int main(int argc, char **argv) hipSetDevice(device); hipDeviceProp_t devProp; - hipDeviceGetProperties(&devProp, device); + hipGetDeviceProperties(&devProp, device); if (devProp.major < 1) { printf("%d does not support HIP\n", device); return -1; diff --git a/tests/src/hipGetDeviceAttribute.cpp b/tests/src/hipGetDeviceAttribute.cpp index 0073dfeed7..51bf29f9e6 100644 --- a/tests/src/hipGetDeviceAttribute.cpp +++ b/tests/src/hipGetDeviceAttribute.cpp @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) int deviceId; CHECK (hipGetDevice(&deviceId)); hipDeviceProp_t props; - CHECK(hipDeviceGetProperties(&props, deviceId)); + CHECK(hipGetDeviceProperties(&props, deviceId)); printf ("info: running on device #%d %s\n", deviceId, props.name); CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeMaxThreadsPerBlock, props.maxThreadsPerBlock)); diff --git a/tests/src/hipHcc.cpp b/tests/src/hipHcc.cpp index 2a8ae9b804..b3580db660 100644 --- a/tests/src/hipHcc.cpp +++ b/tests/src/hipHcc.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) int deviceId; CHECK (hipGetDevice(&deviceId)); hipDeviceProp_t props; - CHECK(hipDeviceGetProperties(&props, deviceId)); + CHECK(hipGetDeviceProperties(&props, deviceId)); printf ("info: running on device #%d %s\n", deviceId, props.name); #ifdef __HCC__ diff --git a/tests/src/hipHostAlloc.cpp b/tests/src/hipHostAlloc.cpp index 7ad6f4b718..a6401e469d 100644 --- a/tests/src/hipHostAlloc.cpp +++ b/tests/src/hipHostAlloc.cpp @@ -15,7 +15,7 @@ float *Ad, *Bd, *Cd; hipDeviceProp_t prop; int device; HIPCHECK(hipGetDevice(&device)); -HIPCHECK(hipDeviceGetProperties(&prop, device)); +HIPCHECK(hipGetDeviceProperties(&prop, device)); if(prop.canMapHostMemory != 1){ std::cout<<"Exiting..."< GPU device has %d Multi-Processors, " diff --git a/tests/src/hip_anyall.cpp b/tests/src/hip_anyall.cpp index 52a2a13db9..21e24d6443 100644 --- a/tests/src/hip_anyall.cpp +++ b/tests/src/hip_anyall.cpp @@ -41,7 +41,7 @@ __global__ void int main(int argc, char *argv[]) { int warpSize, pshift; hipDeviceProp_t devProp; - hipDeviceGetProperties(&devProp, 0); + hipGetDeviceProperties(&devProp, 0); if(strncmp(devProp.name,"Fiji",1)==0) { warpSize =64; pshift =6; diff --git a/tests/src/hip_ballot.cpp b/tests/src/hip_ballot.cpp index 17e86a12ad..5af4c32d7b 100644 --- a/tests/src/hip_ballot.cpp +++ b/tests/src/hip_ballot.cpp @@ -21,7 +21,7 @@ __global__ void int main(int argc, char *argv[]) { int warpSize, pshift; hipDeviceProp_t devProp; - hipDeviceGetProperties(&devProp, 0); + hipGetDeviceProperties(&devProp, 0); if(strncmp(devProp.name,"Fiji",1)==0) {warpSize = 64; pshift =6;} diff --git a/tests/src/hip_brev.cpp b/tests/src/hip_brev.cpp index f722ce1b45..e5c68a5a72 100644 --- a/tests/src/hip_brev.cpp +++ b/tests/src/hip_brev.cpp @@ -94,7 +94,7 @@ int main() { unsigned long long int* deviceD; hipDeviceProp_t devProp; - hipDeviceGetProperties(&devProp, 0); + hipGetDeviceProperties(&devProp, 0); cout << " System minor " << devProp.minor << endl; cout << " System major " << devProp.major << endl; cout << " agent prop name " << devProp.name << endl; diff --git a/tests/src/hip_clz.cpp b/tests/src/hip_clz.cpp index 2cf03148be..18b332b33f 100644 --- a/tests/src/hip_clz.cpp +++ b/tests/src/hip_clz.cpp @@ -118,7 +118,7 @@ int main() { long long int* deviceH; hipDeviceProp_t devProp; - hipDeviceGetProperties(&devProp, 0); + hipGetDeviceProperties(&devProp, 0); cout << " System minor " << devProp.minor << endl; cout << " System major " << devProp.major << endl; cout << " agent prop name " << devProp.name << endl; diff --git a/tests/src/hip_ffs.cpp b/tests/src/hip_ffs.cpp index 5d3ccb7f92..44f172b5f7 100644 --- a/tests/src/hip_ffs.cpp +++ b/tests/src/hip_ffs.cpp @@ -89,7 +89,7 @@ int main() { unsigned long long int* deviceD; hipDeviceProp_t devProp; - hipDeviceGetProperties(&devProp, 0); + hipGetDeviceProperties(&devProp, 0); cout << " System minor " << devProp.minor << endl; cout << " System major " << devProp.major << endl; cout << " agent prop name " << devProp.name << endl; diff --git a/tests/src/hip_popc.cpp b/tests/src/hip_popc.cpp index 0227bdb97c..9c8673891f 100644 --- a/tests/src/hip_popc.cpp +++ b/tests/src/hip_popc.cpp @@ -86,7 +86,7 @@ int main() { unsigned long long int* deviceD; hipDeviceProp_t devProp; - hipDeviceGetProperties(&devProp, 0); + hipGetDeviceProperties(&devProp, 0); cout << " System minor " << devProp.minor << endl; cout << " System major " << devProp.major << endl; cout << " agent prop name " << devProp.name << endl; diff --git a/tests/src/test_common.cpp b/tests/src/test_common.cpp index 3da5568b7c..332c2856d3 100644 --- a/tests/src/test_common.cpp +++ b/tests/src/test_common.cpp @@ -144,7 +144,7 @@ unsigned setNumBlocks(unsigned blocksPerCU, unsigned threadsPerBlock, size_t N) int device; HIPCHECK(hipGetDevice(&device)); hipDeviceProp_t props; - HIPCHECK(hipDeviceGetProperties(&props, device)); + HIPCHECK(hipGetDeviceProperties(&props, device)); unsigned blocks = props.multiProcessorCount * blocksPerCU; if (blocks * threadsPerBlock > N) { diff --git a/util/gedit/hip.lang b/util/gedit/hip.lang index 76f3b84738..21652e22eb 100644 --- a/util/gedit/hip.lang +++ b/util/gedit/hip.lang @@ -226,8 +226,8 @@ hipD3D9SetDirect3DDevice hipD3D9UnmapResources hipD3D9UnregisterResource - hipDeviceGetProperties - hipDeviceSynchronize + hipGetDeviceProperties + hipDeviceSynchronize hipEventCreate hipEventDestroy hipEventElapsedTime diff --git a/util/vim/hip.vim b/util/vim/hip.vim index b64cf53c3f..6f843309c0 100644 --- a/util/vim/hip.vim +++ b/util/vim/hip.vim @@ -92,7 +92,7 @@ syn keyword hipFunctionName hipD3D9ResourceSetMapFlags syn keyword hipFunctionName hipD3D9SetDirect3DDevice syn keyword hipFunctionName hipD3D9UnmapResources syn keyword hipFunctionName hipD3D9UnregisterResource -syn keyword hipFunctionName hipDeviceGetProperties +syn keyword hipFunctionName hipGetDeviceProperties syn keyword hipFunctionName hipDeviceSynchronize syn keyword hipFunctionName hipDeviceReset syn keyword hipFunctionName hipEventCreate