SWDEV-145570 - [HIP] Refactored some g_* stuff
Refactored g_functions into a platform state.
Added a _vars for registered variables.
Added an execution stack similar to Hcc-clang.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#14 edit
[ROCm/hip commit: 732523c0eb]
SWDEV-145570 - [HIP] - Release eStop if it not a nullptr.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_module.cpp#13 edit
[ROCm/hip commit: aeaa9b80f4]
SWDEV-145570 - [HIP] refactor hipMemcpy* functions to correctly handle copies using prepinned memory
The current implementation of hipMemcpy functions picks the copy type based on a flag that the user passes. However, one can use the hipMemcpyHostToDevice/hipMemcpyDeviceToHost flag in a combination with prepinned memory. By using the WriteMemoryCommand/ReadMemoyCommand in this case, we will pin the same host memory twice. This is fine on PAL/Linux, since pinning the same VA range is a noop, but this will start failing once we switch to using device memory with HIP/VDI/HSA.
The solution is to ignore the hipMemcpyKind flag and let the runtime decide what kind of copy is best to do. Except for the case when hipMemcpyHostToHost is passed, since both host pointers may be prepinned.
ReviewBoardURL = http://ocltc.amd.com/reviews/r/15482/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#37 edit
[ROCm/hip commit: 09b46cddf5]
Implement the vector value types in terms of SCALAR_TYPE##SIZE_vector_value_type for float, int, uint and sizes 2, 3, 4, 8, and 16.
[ROCm/hip commit: e0e785a45d]
When shareWithAll memory (e.g., host memory) is allocated, set appId
in hc::AmPointerInfo to -1 to indicate that this memory is not mapped
to any device. Peer checking in ihipStream_t::canSeeMemory is not
necessary if memory is shared with all devices. Thus, it is skipped.
Note that earlier host memory is always mapped to device 0 and HIP
always performs peer checking for all kinds of hipMemcpy. Since the
peer checking process requires context locking, hipMemcpy from/to host
memory always grabs device 0's context lock. Therefore, if there is
another thread holding the context lock of device 0 (e.g.,
hipDeviceSynchronize on device 0), hipMemcpy will have to wait for the
lock until it can actually perform memcpy. This can significantly
deteriorate execution performance.
Signed-off-by: Sarunya Pumma <sarunya.pumma@amd.com>
[ROCm/hip commit: 8111fd3b8b]
Include texture_functions.h on HIP-Clang path. Use HIP vector types instead of hc::short_vectors for texture_functions, and remove HCC headers.
[ROCm/hip commit: 8c50bcfdab]
- Uses c++11 features. Added it to nvcc options
- Arguments for some kernels exceeded 4096 bytes which is the limit
imposed by nvcc. Reduced BLOCK_DIM_SIZE to 512 to handle this
- Fixed compilation issues on nvcc path
Change-Id: I14f6b28afcb7c6b24a085fd707b2104e2ed64627
[ROCm/hip commit: 4c41d62435]
CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS contains -rdynamic which does not go
well with nvcc
Change-Id: I10e6d21553de0e43c6a7ae5fb3ec2418087959ff
[ROCm/hip commit: 36c7670293]