Closed
Conversation
d684b49 to
4b149b0
Compare
- Add conditional includes with HIP_ENABLE_IF, HIP_IS_* macros - Add is_signed and is_convertible template specializations - Replace std::enable_if with HIP_ENABLE_IF throughout - Replace std::is_integral/signed/convertible with HIP_IS_* macros - Allows vector types to work in device compilation without std headers
Add template helper to extract element type from vector types, fixing initialization to properly cast random values to the correct element type before constructing vectors.
- Add null checks for CGN->getFunction() in getInvertedCGNode - Add null checks in getOrCreateInvertedCGNode - Fix use-after-erase bug in popAny function - Add null checks throughout analyze and processFunctions - Fix logic bug in mayCallAbort (was checking wrong condition) - Remove LLVM version conditionals for getNextNonDebugInstruction
- Add explicit static_cast to float/double for math function calls - Add type_casting_intrinsics.hh include to RegressionTest302 - Fix ambiguous function overload resolution for int arguments
Remove device variable that causes hipspv-link to hang, use constant value instead. Add hipDeviceSynchronize and proper cleanup.
Wrap host-only includes and main function in __HIP_DEVICE_COMPILE__ guards to prevent host-only code from being processed during device compilation.
Always use CL/opencl.h instead of Apple's OpenCL/opencl.h framework headers, to use chipStar's bundled headers consistently.
Completed commits 3, 11, 13-20. Commits 22-30 require structural changes from macos-clean that have inheritance incompatibilities.
When getKernelByName fails, log all available kernel names to help diagnose kernel lookup issues.
For unified/SVM memory (like POCL), HostPtr is initially set to DevPtr. Only error if HostPtr is already set to a DIFFERENT pointer.
- Add CL_DEPRECATED and CL_EXT_SUFFIX__VERSION_* macros for compatibility - Rename cl_mem_device_address_EXT to cl_mem_device_address_ext (lowercase)
The macos-clean version removed the PASSED output but ctest requires it to match the PASS regex.
Check if any device variable actually has an initializer before running the reset kernel. This prevents crashes/hangs when the compiler optimizes away device variables but the reset kernel still tries to access them.
When there's only one program object (no device libraries), build directly instead of linking. Also add diagnostic logging for program binary types when linking multiple objects.
The reset kernel handles both global device variables and static local variables in device functions. Don't skip it based on global device variable initializers - static locals need it too.
Add dumpSpirv overload that accepts a name parameter to generate more descriptive filenames: hip-spirv-<name>-<hash>.spv In SPVRegister.cc: - Add getExecutableName() helper (supports macOS and Linux) - Update SPIR-V dump calls to include executable name in filename In CHIPBackendOpenCL.cc: - Update AppendSource lambda to log runtime object names - Dump runtime device libraries with their function names (e.g. atomicAddFloat_native, atomicAddDouble_emulation, ballot_native) This makes it easier to identify which SPIR-V binaries belong to which executable or runtime component when debugging.
On macOS (clvk), hipMalloc uses hipMemoryTypeUnified for proper SVM semantics. On other platforms (POCL, Intel OpenCL, Level Zero), use hipMemoryTypeDevice which is better supported.
…Vars Changed early-return condition from OR to AND logic. The reset kernel must run when it exists, even if ChipVars_ is empty, because static local variables in device functions are not tracked in ChipVars_ but still need to be reset by NonSymbolResetKernel. Fixes hipTestResetStaticVar failure where static local Counter was not reset to initial value after hipDeviceReset().
- Add LLVM library linking for MODULE targets on macOS - Use sched_yield instead of pthread_yield on Apple platforms - Add platform-specific dladdr for finding library path on macOS - Add minimal ELF definitions for spirv-extractor on macOS - Cast pthread_t to void* for spdlog formatting on macOS - Update HIP and HIPCC submodules to macos branches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Results
Test Pass Rate: 96% (1034/1079 tests passing)
Failing Tests (45 tests - 4%)
Double precision operations (6 tests) and Atomic operations (10 tests) - POCL crashes during clLinkProgram so we have to skip runtime device linking
Host memory registration (6 tests) - Error: hipErrorInvalidValue (Host memory is already registered!)
Stream callbacks (3 tests) - Error: Segmentation fault (exit code 139) Callback execution crashes in POCL callback handlers
Platform Adaptations
LLVM (llvm-project)
UnknownOShandling for SPIRV targetsspirv64offload targetschipStar
malloc.hincludes with__APPLE__checksmemalign()wrapper usingposix_memalign()for macOSlinux/limits.h,sys/sysinfo.h) with POSIX alternativesclock()function for macOS (uses busy-wait instead)sysctlinstead of Linux/procHIP Submodule
stdc++fslinking requirement on macOS (filesystem library built into libc++)hip_test_common.hhdevice code to work on macOSwindows.h)HIPCC