HIP uses icd_dispatch.h, which is not a public header. Using the public
CL/cl_icd.h removes inclusion of the private header.
This allows compiling HIP without relying on OCL ICD source, which makes
distributing a standalone ROCclr easier.
For WIN32, a few other headers are required.
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
Change-Id: I0cab173b9753c5b0ab3be9222aa8bb0545cdeaab
Prior to this change, when Git_FOUND was false, HIP_VERSION_BUILD_ID
would be undefined in the CMake code. The value of HIP_VERSION_BUILD_ID
in <hip/hip_version.h> is taken from the CMake variable, so it was being
defined as nothing in those cases. That would cause compilation failures,
as src/hip_global.cpp contains the function:
size_t amd_dbgapi_get_build_id() {
return HIP_VERSION_BUILD_ID;
}
which would become
size_t amd_dbgapi_get_build_id() {
return ;
}
after preprocessing. To prevent this, we can define the version
information to a default value when Git is not found.
A related problem was reported by Harmen Stoppels in
https://github.com/ROCm-Developer-Tools/HIP/pull/2218. When Git
is not available (or if the library is being built from a tarball),
the HIP_VERSION_GITHASH is not defined. This causes trouble because
HIP_LIB_VERSION_STRING is defined as "X.Y.Z-${HIP_VERSION_GITHASH}"
and therefore becomes "X.Y.Z-".
The incomplete version string becomes a problem when it is appended
to the shared library file name. File names that end with '-' confuse
the linker. They cause strange errors when attempting to link to the
HIP library. This problem can be prevented by dropping the trailing
dash and using "X.Y.Z" as the version string when HIP_VERSION_GITHASH
is not defined.
Change-Id: I6e290c1f1b603ba30c9ded885e125d9ca9a2e688
Signed-off-by: Cordell Bloor <Cordell.Bloor@amd.com>
- channel format should be consistent accross parameters
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I1e7680ab9262a66e7bea4aaa21f061044b0f7956
Update HIP's unsafeAtomicAdd to:
- Compile properly even when not compiling for gfx90a
- Fall back to safe atomic add on non-gfx90a architectures
- use flat atomic add for FP64 on gfx90a, instead of dynamically
checking memory spaces.
In addition, when the compiler is passed -munsafe-fp-atomics, it
will define __AMDGCN_UNSAFE_FP_ATOMICS__. When this happens, the
compiler is requesting that the HIP headers force all HIP
atomicAdd() calls on floats or doubles to use their unsafe versions.
This patch thus causes unsafeAtomicAdd() calls when that define
is seen. This call to unsafeAtomicAdd() is also done for atomicSub(),
since that calls atomicAdd underneath. This is not done for
system-scope atomicAdd because, on gfx90a, system-scope atomic FP
add instructions would need to target fine-grained memory, which is
always unsafe.
This patch also creates safeAtomicAdd() functions for float and double.
These functions will create a standalone safe atomic, even when the
application is compiled with -munsafe-fp-atomics.
Finally, this patch adds wrappers in the Nvidia path of HIP so that
these HIP functions call through to atomicAdd there as well.
Change-Id: I8af0621d3d28ea30c9278bfeea7393d03bbdac6d
- hipHostRegister should return hipErrorInvalidValue when size is 0 or
size doesn't match the actual allocated size
- hipMemAllocPitch should return hipErrorInvalidValue when width or height
is 0 and elementSizeBytes should be 4, 8 or 16
Change-Id: I43c9fe4ac1ef0a6ac2f953908d301508a7bc5aa3
Using device write to set 0 to signal while streamWaitEvent is checking
the signal.
Use app in SWDEV-314307 to verify this fix
Requires vdi #668012 change to work
Change-Id: Ie329a29cfaeb5d144b92cda36773646f913ca73d
- hipMemcpy[From/To]Symbol APIs to return hipErrorInvalidMemcpyDirection
if the copy kind is incorrect
- hipGetSymbolSize and hipGetSymbolAddress APIs to return hipErrorInvalidValue
if the pointer is null
Change-Id: I32f428045c804b1e4f648e91b507f749f60c09d0
Some components like tensorflow search for the contents of hip_version.h
For backward compatibility insert actual file contents in wrapper file as non executable code
Improvements: wrapper header template file checked in, instead of generating it on runtime
Redundant codes for unsetting variables removed
Change-Id: I67ee48437f8959d8ed70946412d09be3ed262e58
Add lock protection for access to the pool list.
Remove destroyed stream from the list of the safe streams
Change-Id: I1863b89bd3f5e188c161227cc790c3adaf72cc58
Honor hipEventReleaseToDevice and hipEventReleaseToSystem flags.
hipEventRecord would flush caches if no release flags are provided. To
change this behavior set ROC_EVENT_NO_FLUSH=1
Change-Id: I03e41b515b1d0cf963b0c2d5b9901b09e71a0e59