Update atomic functional tests (#262)
* feat: implement function to return number of blocks in grid.
* test: update atomics functional tests
- Standard atomic tests: `atomic_add`, `atomic_inc`, `fetch_atomic_add`, `fetch_atomic_inc`, and `fetch_compare_and_swap`
- Bitwise atomic tests: `atomic_and`, `atomic_or`, `atomic_xor`, fetch_atomic_and`, `fetch_atomic_or`, and `fetch_atomic_xor`
- Extended atomic tests: `atomic_fetch`, `atomic_set`, and `atomic_swap`
* Added two different address modes for atomics.
* Added all supported data types for atomics tests.
[ROCm/rocshmem commit: 0a4f8a83b9]
This commit is contained in:
committed by
GitHub
parent
ac13b22edc
commit
e31b4d42e5
@@ -191,6 +191,13 @@ __device__ __forceinline__ int get_flat_block_id() {
|
||||
hipThreadIdx_z * hipBlockDim_x * hipBlockDim_y;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the number of blocks in the caller's flattened grid.
|
||||
*/
|
||||
__device__ __forceinline__ int get_grid_num_blocks() {
|
||||
return hipGridDim_x * hipGridDim_y * hipGridDim_z;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the flattened block index that the calling thread is a member of in
|
||||
* in the grid. Callers from the same block will have the same index.
|
||||
|
||||
Reference in New Issue
Block a user