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/clr commit: 2ff260c727]
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/clr commit: e638c1377f]
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/clr commit: b02040e934]
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/clr commit: ff1e49d191]
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/clr commit: 84aadb9274]
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/clr commit: bf6fdca1e8]
- 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/clr commit: 51307ac705]
CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS contains -rdynamic which does not go
well with nvcc
Change-Id: I10e6d21553de0e43c6a7ae5fb3ec2418087959ff
[ROCm/clr commit: 7a5987e289]
I've noticed that in the generated makefiles, we'd have
if(NOT build_configuration)
set(build_configuration Debug)
endif()
However, only definitions with all capitals are provided.
e.g.
set(HIP_HCC_FLAGS_DEBUG -g)
This is because of lines 442 to 448. We capitalize the configuration ${config_upper}.
This PR fixes this bug.
[ROCm/clr commit: 25c780c89e]
Add support of environment variable HIP_VDI_HOME.
By setting environment variable HIP_VDI_HOME to the distribution directory of HIP/VDI, hipcc
will choose proper include and lib path for hip-clang.
[ROCm/clr commit: 4627aa0085]