2
0

Cleanup files from code review.

- Remove some stale code
- Update docs
- Correct define for __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__

Change-Id: Ic5e3cdb8269b1c18f6d2693700b55e08c4d0080e


[ROCm/clr commit: aa3e04cf9a]
Este cometimento está contido em:
Ben Sander
2016-10-15 11:51:20 -05:00
ascendente 57adbf2a17
cometimento fc7eefb5c8
5 ficheiros modificados com 23 adições e 56 eliminações
+18 -49
Ver ficheiro
@@ -18,9 +18,9 @@ After making HIP, don't forget the "make install" step !
## Adding a new HIP API
- Add a translation to the bin/hipify tool ; many examples abound.
- Add a translation to the hipify-clang tool ; many examples abound.
- For stat tracking purposes, place the API into an appropriate stat category ("dev", "mem", "stream", etc).
- Add a inlined NVCC implementation for the function in include/nvcc_detail/hip_runtime_api.h.
- Add a inlined NVCC implementation for the function in include/hip/nvcc_detail/hip_runtime_api.h.
- These are typically headers
- Add an HCC definition and Doxygen comments for the function in include/hcc_detail/hip_runtime_api.h
- Source implementation typically go in src/hcc_detail/hip_hcc.cpp. The implementation may involve
@@ -61,7 +61,7 @@ The unix `date` command can print the HCC-format work-week for a specific date ,
```
> date --utc +%y%W%w -d 2015-11-09
15451
```
## Unit Testing Environment
@@ -125,60 +125,29 @@ Differences or limitations of HIP APIs as compared to CUDA APIs should be clearl
is used by the GetLastError and PeekLastError functions - if a HIP API simply returns, then the error will not be logged correctly.
#### Presubmit Testing:
Before checking in or submitting a pull request, run all Rodinia tests and ensure pass results match starting point:
Before checking in or submitting a pull request, run all directed tests (see tests/README.md) and all Rodinia tests.
Ensure pass results match starting point:
```shell
> cd examples/
> ./run_all.sh
```
Recent results :
```
hip2/examples/rodinia_3.0/hip$ make test
--TESTING: b+tree
executing: ../../test/b+tree/run0.cmd... PASSED!
--TESTING: backprop
executing: ../../test/backprop/run0.cmd... PASSED!
--TESTING: bfs
executing: ../../test/bfs/run0.cmd... PASSED!
executing: ../../test/bfs/run1.cmd... PASSED!
--TESTING: cfd
executing: ../../test/cfd/run0.cmd... PASSED!
executing: ../../test/cfd/run1.cmd... PASSED!
--TESTING: gaussian
executing: ../../test/gaussian/run0.cmd... PASSED!
--TESTING: heartwall
executing: ../../test/heartwall/run0.cmd... PASSED!
--TESTING: hotspot
executing: ../../test/hotspot/run0.cmd... PASSED!
--TESTING: kmeans
executing: ../../test/kmeans/run0.cmd... PASSED!
executing: ../../test/kmeans/run1.cmd... PASSED!
executing: ../../test/kmeans/run2.cmd... PASSED!
executing: ../../test/kmeans/run3.cmd... PASSED!
--TESTING: lavaMD
executing: ../../test/lavaMD/run0.cmd... PASSED!
executing: ../../test/lavaMD/run1.cmd... PASSED!
executing: ../../test/lavaMD/run2.cmd... PASSED!
executing: ../../test/lavaMD/run3.cmd... PASSED!
executing: ../../test/lavaMD/run4.cmd... PASSED!
--TESTING: lud
executing: ../../test/lud/run0.cmd... PASSED!
--TESTING: myocyte
executing: ../../test/myocyte/run0.cmd... PASSED!
--TESTING: nn
executing: ../../test/nn/run0.cmd... PASSED!
--TESTING: nw
executing: ../../test/nw/run0.cmd... PASSED!
--TESTING: pathfinder
executing: ../../test/pathfinder/run0.cmd... PASSED!
--TESTING: srad
executing: ../../test/srad/run0.cmd... PASSED!
--TESTING: streamcluster
executing: ../../test/streamcluster/run0.cmd... PASSED!
```
#### Checkin messages
Follow existing best practice for writing a good Git commit message. Some tips:
http://chris.beams.io/posts/git-commit/
https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message
In particular :
- Use imperative voice, ie "Fix this bug", "Refactor the XYZ routine", "Update the doc".
Not : "Fixing the bug", "Fixed the bug", "Bug fix", etc.
- Subject should summarize the commit. Do not end subject with a period. Use a blank line
after the subject.
## Doxygen Editing Guidelines
@@ -2,17 +2,17 @@
| **CUDA** | **HIP** | **CUDA description** |
|-----------------------------------------------------------|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| `cudaChooseDevice` | | Select compute-device which best matches criteria. |
| `cudaChooseDevice` | `hipChooseDevice` | Select compute-device which best matches criteria. |
| `cudaDeviceGetAttribute` | `hipDeviceGetAttribute` | Returns information about the device. |
| `cudaDeviceGetByPCIBusId` | | Returns a handle to a compute device. |
| `cudaDeviceGetCacheConfig` | `hipDeviceGetCacheConfig` | Returns the preferred cache configuration for the current device. |
| `cudaDeviceGetLimit` | | Returns resource limits. |
| `cudaDeviceGetLimit` | `hipDeviceGetLimit` | Returns resource limits. |
| `cudaDeviceGetPCIBusId` | | Returns a PCI Bus Id string for the device. |
| `cudaDeviceGetSharedMemConfig` | `hipDeviceGetSharedMemConfig` | Returns the shared memory configuration for the current device. |
| `cudaDeviceGetStreamPriorityRange` | | Returns numerical values that correspond to the least and greatest stream priorities. |
| `cudaDeviceReset` | `hipDeviceReset` | Destroy all allocations and reset all state on the current device in the current process. |
| `cudaDeviceSetCacheConfig` | `hipDeviceSetCacheConfig` | Sets the preferred cache configuration for the current device. |
| `cudaDeviceSetLimit` | | Set resource limits. |
| `cudaDeviceSetLimit` | `hipDeviceSetLimit` | Set resource limits. |
| `cudaDeviceSetSharedMemConfig` | `hipDeviceSetSharedMemConfig` | Sets the shared memory configuration for the current device. |
| `cudaDeviceSynchronize` | `hipDeviceSynchronize` | Wait for compute device to finish. |
| `cudaGetDevice` | `hipGetDevice` | Returns which device is currently being used. |
-2
Ver ficheiro
@@ -29,8 +29,6 @@ THE SOFTWARE.
#error("This version of HIP requires a newer version of HCC.");
#endif
#define USE_MEMCPYTOSYMBOL
#define USE_DISPATCH_HSA_KERNEL 0
//
+1 -1
Ver ficheiro
@@ -45,7 +45,7 @@ kernelName<<<numblocks,numthreads,memperblock,streamId>>>(0, ##__VA_ARGS__);\
#define __HIP_ARCH_HAS_GLOBAL_FLOAT_ATOMIC_EXCH__ (__CUDA_ARCH__ >= 110)
#define __HIP_ARCH_HAS_SHARED_INT32_ATOMICS__ (__CUDA_ARCH__ >= 120)
#define __HIP_ARCH_HAS_SHARED_FLOAT_ATOMIC_EXCH__ (__CUDA_ARCH__ >= 120)
#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__
#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__ (__CUDA_ARCH__ >= 200)
// 64-bit Atomics:
#define __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__ (__CUDA_ARCH__ >= 200)
+1 -1
Ver ficheiro
@@ -1435,7 +1435,7 @@ void ihipSetTs(hipEvent_t e)
// Returns true if thisCtx can see the memory allocated on dstCtx and srcCtx.
// The peer-list for a context controls which contexts have access to the memory allocated on that context.
// So we check dstCtx's and srcCtx's peerList to see if the booth include thisCtx.
// So we check dstCtx's and srcCtx's peerList to see if the both include thisCtx.
bool ihipStream_t::canSeePeerMemory(const ihipCtx_t *thisCtx, ihipCtx_t *dstCtx, ihipCtx_t *srcCtx)
{
tprintf (DB_COPY1, "Checking if direct copy can be used. thisCtx:%s; dstCtx:%s ; srcCtx:%s\n",