- Don't pass uint32_t arguments by reference.
- Use nullptr instead of NULL.
- Don't add frivolous typedefs.
- Use correct types when available instead of generic integral types.
- Make all roctracer callbacks extern "C" to prepare for a future change
that will be removing their declaration from hip_runtime_api.h.
- Rename cb/sem sync and release functions -> reader_lock/writer_lock
acquire and release.
Change-Id: If203fee077d421a9782fcd34607a413b8c3dcfc8
When acquiring the reader's lock (sem_sync()...sem_release()), it is
possible for a writer to squeeze by if the reader goes into sync_wait().
The writer could re-acquire the entry.sync between entry.sem > 0 and
entry.sync = 0.
void sync_wait(uint32_t id) {
sem_decrement(id);
while (entry(id).sync.load()) {}
// <--- HERE
sem_increment(id);
}
This could result in both the reader and the writer accessing
{ callback, arg } at the same time, and the reader could read
inconsistent data, for example: { new callback, old arg }.
The solution is to re-test entry.sync when returning from sync_wait():
void sem_sync(uint32_t id) {
sem_increment(id);
- if (entry(id).sync.load() == true) sync_wait(id);
+ while (entry(id).sync.load() == true) sync_wait(id);
}
Change-Id: I22f74f4cb9a5f027aac8aa4ed3e633acc19df4b8
Part 3: Add missing declaration of wall_clock64() to fix
compiling issue in device code.
Add querying hipDeviceAttributeWallClockRate.
Change-Id: Ie54771c2f58eeaacdc0248bc116ef193f99eb9b9
As per the requirements in SWDEV-287540, config files should not have hard coded /opt/rocm path
Instead of setting ROCM_PATH to /opt/rocm, used hip-config file path to find the rocm path
Validated by printing the CONFIG_PATH and is coming as/opt/rocm-ver/lib/cmake/hip/hip-config.cmake
So need four level up,with file name in the path
Change-Id: Iac01d3a0c0168138c777551165705ed56cf6c3b1
- move removing the array from array set earlier to avoid race condition
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I9003c991e3e0f47ed0509ddfdbeaa145b5a1e0f1
- hiprtcAddLinkData should accept 0 or null as input name
- hiprtcLinkCreate should accept 0 or null as options ptr
- hiprtcCompile should send -fgpu-rdc option to comgr if its present in the options
Change-Id: I84f6e36df5c99b719ee9c67dfc1b4dbcfd8e3172
Stream is not important to get the kernel
name from Function that can be found in
the functions_ map.
Change-Id: I164bc3ebcc5552359856e76204d8b124ba0d2f34
- Otherwise this consumes the caller's stdin by accident.
Patch by:
- Bolo -- Josef Burger
- https://github.com/bigtrak
Change-Id: I669376c025c0cde2cfdd59b5a4a14a71c5d8e862
HIP build scripts updated, so that cmake install prefix and cpack packaging prefix doesn't have destination directory hip
The workaround in source code is not at all required.
Depends-On: I6775407b4bfec84b6b911d333f3725c310539bfc
Change-Id: Ic1f5e170690d6dba0fec493143dea390c435cd42