corrected hipDeviceGetProperties to hipGetDeviceProperties - not docs

[ROCm/hip commit: d3ba2b9782]
This commit is contained in:
Aditya Atluri
2016-03-06 08:31:04 -06:00
والد 3c91a6d0a7
کامیت f1b8758919
24فایلهای تغییر یافته به همراه27 افزوده شده و 27 حذف شده
+1 -1
مشاهده پرونده
@@ -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.
===================================================================================================
+1 -1
مشاهده پرونده
@@ -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;
@@ -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;
```
@@ -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 ...
@@ -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);
@@ -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;
@@ -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);
@@ -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);
@@ -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;
+1 -1
مشاهده پرونده
@@ -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);
@@ -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;
@@ -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));
@@ -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__
@@ -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..."<<std::endl;
}
@@ -258,7 +258,7 @@ void runTest(int argc, char **argv)
deviceProp.minor = 0;
int dev = 0;
hipDeviceGetProperties(&deviceProp, dev);
hipGetDeviceProperties(&deviceProp, dev);
// Statistics about the GPU device
printf("> GPU device has %d Multi-Processors, "
@@ -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;
@@ -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;}
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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) {
@@ -226,8 +226,8 @@
<keyword>hipD3D9SetDirect3DDevice</keyword>
<keyword>hipD3D9UnmapResources</keyword>
<keyword>hipD3D9UnregisterResource</keyword>
<keyword>hipDeviceGetProperties</keyword>
<keyword>hipDeviceSynchronize</keyword>
<keyword>hipGetDeviceProperties</keyword>
<keyword>hipDeviceSynchronize</keyword>
<keyword>hipEventCreate</keyword>
<keyword>hipEventDestroy</keyword>
<keyword>hipEventElapsedTime</keyword>
@@ -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