This commit is contained in:
TheK0tYaRa 2025-05-06 17:52:13 +03:00
parent 2dac0c3078
commit 5c60584ba7
134 changed files with 0 additions and 8030 deletions

View file

@ -1,15 +0,0 @@
DIST hip-5.7.1.tar.gz 553774 BLAKE2B f88c235f688d3a662ec6cb4ad7fe3f82c0015015997871609cc30ab5b2f7fcb9709a08683d77194e45a6dbbe1d24c6355b128d2ecf655f1dea3468711c64e0a3 SHA512 68fa8753725b53c999d102d254c6b1dba53af4e00d6a48db93d10213cc02eec30b4a39c66e773d4f625dd9636cf8b0c5faa05b69fac27cf5a6b19dd3ddd2b905
DIST hip-6.1.1.tar.gz 247192 BLAKE2B c40bb483fb61b3037693f456e546046598df7e0dd81a1f1c8d222ab0d9c0752092ce85c8533bd355f883dda5ce1f32f7ff2b2a58cebac50d53e0e7f4d85ca3ae SHA512 3e6162938294a74af51bc2161ada38dc4ba19614e182238f320f2052a9025be6ea413e40f00cb80f4e86696793d6c4431e2417ea798a2330886a3f3e66aedf0d
DIST hip-6.1.2.tar.gz 247193 BLAKE2B e343bdf233752e40cdefa0c2bbd56858bbb471155045ae1adcf651ddff2ed40dc7c7069998a35e9b26324fdf1c972e13e1222406bc52ae2591c23a45611864c5 SHA512 771f6494c7ff0ddb7d22193dfdbb3fb9461f6e4be347ecb879bb84c5a01a95fb4c4d3f7a0f039265d5369f6c6a5b66949af7bc91ed220f5e81a5b15ec98a68eb
DIST hip-6.3.2.tar.gz 1486601 BLAKE2B 033a02c9b4bdcfcd8d23281df74f061e557b0027e95a76431a5b7f56922306a317d36896619bfb5106103cb34ac2369b85fd603c7dfd9e4f2a6cc1537b168f81 SHA512 839d19d47326c56ae5f44b39a2f62c215692cf9ddbc292becb3ce5b5d1784d92c98ce8f73bc1a294a2cd7c875568b38c9e2053b3646513516b31a9ab1e91d688
DIST hip-6.3.3.tar.gz 1486598 BLAKE2B 998b28786c0b156cd1c23a01ce284206d1ad5cad1f207676b9d40994dc4f60d16a1f0804cfa287622826d78871ee19d2b5aa78dc29a69fe54ab50f08652bfd26 SHA512 70544467c5c262fab1e9415f5e77d0ec3b4635b6fa104de5d7ab2da0e2ca88fe40ce716068e50eaa17a807516cd41e2c0af22bcada3a1f7de50aa88283850e38
DIST hip-test-6.1.1.tar.gz 1080605 BLAKE2B 7eddf648be31365479baa0cd4fd1c060a682a6b44d923cac1c4840c0768782db2fef4e5d97318ef0423be1e5c85b1a0cc6b9d324db789dad28be17f64ab38cae SHA512 0dd679c5b94a59e192bea5789f4448b53ac23c8a03b24a347758b1d70ff692483fd4aaea0b19345eb6ffb82a4492ed21958398b53ae6244a244a660dfa33412f
DIST hip-test-6.1.2.tar.gz 1080493 BLAKE2B ff501ab92c1d3207e330f5e9630e3300aa52f7c2acfae2173a964a2843952db90eea2b4ecf5db1ec6ba65d7764750b9eae3f2a9641d1a3fc71d5172e3a7264a8 SHA512 09fa4243c8b73ddbe163ff4c60f0f8f4182f1a37071e9747bf95ecdc219ba3a0407bdf1e2391481f537b223565a38f16e918667194666558a469d94f88a1e236
DIST hip-test-6.3.2.tar.gz 1446861 BLAKE2B c82f8b52807bdae7ea32bd85cccaaea8e01fda440c36ef68603c3cac5d31032b10a21e3828702fec556fa8c262797f08cc2395e042d5db8c6ae601968d47ed8a SHA512 aa162ab73e0ef2b739a8652cdd34eb4fbef130d75ac7aaece030263d820ef0abfb124a10692937da529ac523c386ba2b8241c9a205c820b41e6b7090770653e2
DIST hip-test-6.3.3.tar.gz 1446849 BLAKE2B 474194bd7cef54af85eab0bc8fdfbe2360a9a22ab27f9014ebbb22f03952bfc014d682e2a0cbf90fcd365b4295df266a64419deebbce38aa7b5b7af9c979cc20 SHA512 65bde402804e95a09142bc2a9866bbef14068b63d09236d70086e15c3927ef29fb75d0859a90aa4bc75ebe03f94da85284b233fb41b95246bb45d1d8fee172ed
DIST rocm-5.7.0.tar.gz 845881 BLAKE2B 08255edc1407e5ef85895336b11496319695318fce265565728ad75175b5e1dfab98f696fee2d27e60c48e862f721fad4c53118cc70b807353fff5f97ed72ac2 SHA512 72420e16c7cfe9687e030331838666dabaa43d686bdad1d109431e44db99070a2cf6dd64b59e3275019abedd6612f6008c798a79275e7225b6b122fb9f644660
DIST rocm-clr-5.7.1.tar.gz 2008647 BLAKE2B 3db0760d6f83504e60caf88a2dd5e0bc02c7db9d6f263ad0eb2cfc79aa0f88a3699c412844a0158a796d9d02e79660287e791edad787d814eefffea4fd2298b4 SHA512 d79323481d82fc02c12a32cdcc0d14437d512af023e7737db0387b7eecb27fe6e4ae7c71d6adce57932a04bb24c880440d9dc10aeb5af11a4f2ca64d44330965
DIST rocm-clr-6.1.1.tar.gz 2031034 BLAKE2B b0485bb015d31986f4988d1db0c029c826856e50b5bb1b58fac2097c14b3966668f1b8d41ec198889e27ac860497a8b3c081ec31d52390d5c9ff5db092bf7cce SHA512 86925e8b9a9e77b06a57daefbc7279887b4ef7c6a79c3717bc2f2d3bf29926281c60063fd17e21c65d7def520d9f579bf88f69051d053a38750ba968f69ca3fc
DIST rocm-clr-6.1.2.tar.gz 2031283 BLAKE2B d51d32a77794ea97f1a3817786c9fd6b482106b665eea6e2c9b4c11e4dce19a3486386eb5ba111554c2d82c30e2a93add7502eed5768caf3fb709fb5fbb2e71b SHA512 e97224451864efe0084c4117f54893c9624a6a9f365a0b4abad08fd9635f008dea742dc589429fbb714e1b8177d06362c0f5a741f6c4a050d0fd4d48da72d54b
DIST rocm-clr-6.3.2.tar.gz 2095677 BLAKE2B 2f1122a2058f8ba358fe48a46473f23c46a5413fef16515f103c21a8ae13bb76522fbe587cb9c9e6e3dd06f968402b6a881391823c80381c0c41072597c845ac SHA512 5bade294dc6fc60bf459bfd7124c354f2b0079167d3c8776a9e3d6d8320bb9b1a2a0770a466987e164994293024bf47de158ba207f077968dfccb7bf20fb884b
DIST rocm-clr-6.3.3.tar.gz 2095704 BLAKE2B bdb315fc9f1f9c76aa2a345bd48a600c81f3b72eb68fee8862b5e155e7519bef6f6421698a43358c6fe0200bb0b6924ff819860d9a91a5c07fc3e9d44eeb1b16 SHA512 94d2959b981b324e0dae2d06e86c72cd01fa495de081666bcec2445c02bada22aa60e94ecac0ee63e70e52275f92caeefcb6dc96a3f0fba593896be7b0d8ab42

View file

@ -1,13 +0,0 @@
diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt
index a472c5b7a..ac6fdc2ab 100755
--- a/hipamd/CMakeLists.txt
+++ b/hipamd/CMakeLists.txt
@@ -396,8 +396,6 @@ if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin)
install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin)
install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin)
- install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)
- install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)
endif()
#############################

View file

@ -1,13 +0,0 @@
Disable stack-protector (which is enabled by default gentoo-hardened) in device code.
This is not required after https://github.com/llvm/llvm-project/pull/70799, but helps with older clang.
Upstream bug: https://github.com/ROCm-Developer-Tools/clr/issues/21
--- a/hipamd/src/hiprtc/hiprtcInternal.cpp
+++ b/hipamd/src/hiprtc/hiprtcInternal.cpp
@@ -144,6 +144,7 @@ RTCCompileProgram::RTCCompileProgram(std::string name_) : RTCProgram(name_), fgp
compile_options_.push_back("-nogpuinc");
compile_options_.push_back("-Wno-gnu-line-marker");
compile_options_.push_back("-Wno-missing-prototypes");
+ compile_options_.push_back("-fno-stack-protector");
#ifdef _WIN32
compile_options_.push_back("-target");
compile_options_.push_back("x86_64-pc-windows-msvc");

View file

@ -1,31 +0,0 @@
Upstream bug: https://github.com/ROCm-Developer-Tools/clr/issues/22
--- a/hipamd/src/hip_embed_pch.sh
+++ b/hipamd/src/hip_embed_pch.sh
@@ -178,6 +178,7 @@ EOF
echo "// Automatically generated script for HIP RTC." > $mcinFile
if [[ $isWindows -eq 0 ]]; then
+ echo " .section .note.GNU-stack,"",%progbits" >> $mcinFile
echo " .type __hipRTC_header,@object" >> $mcinFile
echo " .type __hipRTC_header_size,@object" >> $mcinFile
fi
--- a/hipamd/src/hiprtc/cmake/HIPRTC.cmake
+++ b/hipamd/src/hiprtc/cmake/HIPRTC.cmake
@@ -98,6 +98,7 @@ macro(generate_hiprtc_mcin HiprtcMcin HiprtcPreprocessedInput)
set(HIPRTC_TYPE_LINUX_ONLY "")
else()
set(HIPRTC_TYPE_LINUX_ONLY
+ " .section .note.GNU-stack,\"\",%progbits\n"
" .type __hipRTC_header,@object\n"
" .type __hipRTC_header_size,@object")
endif()
--- a/hipamd/src/hip_embed_pch.sh
+++ b/hipamd/src/hip_embed_pch.sh
@@ -111,6 +111,7 @@ cat >$tmp/hip_pch.h <<EOF
EOF
cat >$tmp/hip_pch.mcin <<EOF
+ .section .note.GNU-stack,"",%progbits
.type __hip_pch_wave32,@object
.section .hip_pch_wave32,"aMS",@progbits,1
.data

View file

@ -1,236 +0,0 @@
Combined with matching changes within rocr-runtime ebuild, this patch allows
to load compatible kernels whenever possible.
For example if AMDGPU_TARGETS is set to gfx1030 and some application
was started on gfx1036, it loads gfx1030 kernel.
Author: Cordell Bloor <cgmb@slerp.xyz>
https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0025-improve-rocclr-isa-compatibility-check.patch
https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026-extend-hip-isa-compatibility-check.patch
--- a/hipamd/src/hip_code_object.cpp
+++ b/hipamd/src/hip_code_object.cpp
@@ -390,47 +390,123 @@ static bool getTripleTargetID(std::string bundled_co_entry_id, const void* code_
return true;
}
-static bool isCodeObjectCompatibleWithDevice(std::string co_triple_target_id,
- std::string agent_triple_target_id) {
+struct GfxPattern {
+ std::string root;
+ std::string suffixes;
+};
+
+static bool matches(const GfxPattern& p, const std::string& s) {
+ if (p.root.size() + 1 != s.size()) {
+ return false;
+ }
+ if (0 != std::memcmp(p.root.data(), s.data(), p.root.size())) {
+ return false;
+ }
+ return p.suffixes.find(s[p.root.size()]) != std::string::npos;
+}
+
+static bool isGfx900EquivalentProcessor(const std::string& processor) {
+ return matches(GfxPattern{"gfx90", "029c"}, processor);
+}
+
+static bool isGfx900SupersetProcessor(const std::string& processor) {
+ return matches(GfxPattern{"gfx90", "0269c"}, processor);
+}
+
+static bool isGfx1030EquivalentProcessor(const std::string& processor) {
+ return matches(GfxPattern{"gfx103", "0123456"}, processor);
+}
+
+static bool isGfx1010EquivalentProcessor(const std::string& processor) {
+ return matches(GfxPattern{"gfx101", "0"}, processor);
+}
+
+static bool isGfx1010SupersetProcessor(const std::string& processor) {
+ return matches(GfxPattern{"gfx101", "0123"}, processor);
+}
+
+enum CompatibilityScore {
+ CS_EXACT_MATCH = 1 << 4,
+ CS_PROCESSOR_MATCH = 1 << 3,
+ CS_PROCESSOR_COMPATIBLE = 1 << 2,
+ CS_XNACK_SPECIALIZED = 1 << 1,
+ CS_SRAM_ECC_SPECIALIZED = 1 << 0,
+ CS_INCOMPATIBLE = 0,
+};
+
+static int getProcessorCompatibilityScore(const std::string& co_processor,
+ const std::string& agent_processor) {
+ if (co_processor == agent_processor)
+ return CS_PROCESSOR_MATCH;
+
+ if (isGfx900SupersetProcessor(agent_processor))
+ return isGfx900EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE;
+
+ if (isGfx1010SupersetProcessor(agent_processor))
+ return isGfx1010EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE;
+
+ if (isGfx1030EquivalentProcessor(agent_processor))
+ return isGfx1030EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE;
+
+ return CS_INCOMPATIBLE;
+}
+
+static int getCompatiblityScore(std::string co_triple_target_id,
+ std::string agent_triple_target_id) {
// Primitive Check
- if (co_triple_target_id == agent_triple_target_id) return true;
+ if (co_triple_target_id == agent_triple_target_id) return CS_EXACT_MATCH;
// Parse code object triple target id
if (!consume(co_triple_target_id, std::string(AMDGCN_TARGET_TRIPLE) + '-')) {
- return false;
+ return CS_INCOMPATIBLE;
}
std::string co_processor;
char co_sram_ecc, co_xnack;
if (!getTargetIDValue(co_triple_target_id, co_processor, co_sram_ecc, co_xnack)) {
- return false;
+ return CS_INCOMPATIBLE;
}
- if (!co_triple_target_id.empty()) return false;
+ if (!co_triple_target_id.empty()) return CS_INCOMPATIBLE;
// Parse agent isa triple target id
if (!consume(agent_triple_target_id, std::string(AMDGCN_TARGET_TRIPLE) + '-')) {
- return false;
+ return CS_INCOMPATIBLE;
}
std::string agent_isa_processor;
char isa_sram_ecc, isa_xnack;
if (!getTargetIDValue(agent_triple_target_id, agent_isa_processor, isa_sram_ecc, isa_xnack)) {
- return false;
+ return CS_INCOMPATIBLE;
}
- if (!agent_triple_target_id.empty()) return false;
+ if (!agent_triple_target_id.empty()) return CS_INCOMPATIBLE;
// Check for compatibility
- if (agent_isa_processor != co_processor) return false;
- if (co_sram_ecc != ' ') {
- if (co_sram_ecc != isa_sram_ecc) return false;
+ int processor_score = getProcessorCompatibilityScore(co_processor, agent_isa_processor);
+ if (processor_score == CS_INCOMPATIBLE) {
+ return CS_INCOMPATIBLE;
}
- if (co_xnack != ' ') {
- if (co_xnack != isa_xnack) return false;
+
+ int xnack_bonus;
+ if (co_xnack == ' ') {
+ xnack_bonus = 0;
+ } else if (co_xnack == isa_xnack) {
+ xnack_bonus = CS_XNACK_SPECIALIZED;
+ } else {
+ return CS_INCOMPATIBLE;
}
- return true;
+ int sram_ecc_bonus;
+ if (co_sram_ecc == ' ') {
+ sram_ecc_bonus = 0;
+ } else if (co_sram_ecc == isa_sram_ecc) {
+ sram_ecc_bonus = CS_SRAM_ECC_SPECIALIZED;
+ } else {
+ return CS_INCOMPATIBLE;
+ }
+
+ return processor_score + xnack_bonus + sram_ecc_bonus;
}
// This will be moved to COMGR eventually
@@ -483,6 +559,7 @@ hipError_t CodeObject::extractCodeObjectFromFatBinary(
for (size_t i = 0; i < agent_triple_target_ids.size(); i++) {
code_objs.push_back(std::make_pair(nullptr, 0));
}
+ std::vector<int> compatibility_score(agent_triple_target_ids.size());
const auto obheader = reinterpret_cast<const __ClangOffloadBundleHeader*>(data);
const auto* desc = &obheader->desc[0];
@@ -495,17 +572,19 @@ hipError_t CodeObject::extractCodeObjectFromFatBinary(
reinterpret_cast<const void*>(reinterpret_cast<uintptr_t>(obheader) + desc->offset);
const size_t image_size = desc->size;
- if (num_code_objs == 0) break;
std::string bundleEntryId{desc->bundleEntryId, desc->bundleEntryIdSize};
std::string co_triple_target_id;
if (!getTripleTargetID(bundleEntryId, image, co_triple_target_id)) continue;
for (size_t dev = 0; dev < agent_triple_target_ids.size(); ++dev) {
- if (code_objs[dev].first) continue;
- if (isCodeObjectCompatibleWithDevice(co_triple_target_id, agent_triple_target_ids[dev])) {
+ if (compatibility_score[dev] >= CS_PROCESSOR_MATCH) continue;
+ int score = getCompatiblityScore(co_triple_target_id, agent_triple_target_ids[dev]);
+ if (score > compatibility_score[dev]) {
+ compatibility_score[dev] = score;
+ if (!code_objs[dev].first)
+ --num_code_objs;
code_objs[dev] = std::make_pair(image, image_size);
- --num_code_objs;
}
}
}
--- a/rocclr/device/device.cpp
+++ b/rocclr/device/device.cpp
@@ -234,10 +234,49 @@ std::string Isa::isaName() const {
return std::string(hsaIsaNamePrefix) + targetId();
}
+template <class T, std::size_t N>
+static bool Contains(const std::array<T, N>& arr, const T& value) {
+ return std::find(std::begin(arr), std::end(arr), value) != std::end(arr);
+}
+
+static bool IsVersionCompatible(const Isa &codeObjectIsa,
+ const Isa &agentIsa) {
+ if (codeObjectIsa.versionMajor() == agentIsa.versionMajor() &&
+ codeObjectIsa.versionMinor() == agentIsa.versionMinor()) {
+
+ if (codeObjectIsa.versionStepping() == agentIsa.versionStepping()) {
+ return true; // exact match
+ }
+
+ // The code object and the agent may sometimes be compatible if
+ // they differ only by stepping version.
+ if (codeObjectIsa.versionMajor() == 9 &&
+ codeObjectIsa.versionMinor() == 0) {
+ const std::array<uint32_t, 4> gfx900_equivalent = { 0, 2, 9, 12 };
+ const std::array<uint32_t, 5> gfx900_superset = { 0, 2, 6, 9, 12 };
+ if (Contains(gfx900_equivalent, codeObjectIsa.versionStepping()) &&
+ Contains(gfx900_superset, agentIsa.versionStepping())) {
+ return true; // gfx900 compatible object and agent
+ }
+ } else if (codeObjectIsa.versionMajor() == 10) {
+ if (codeObjectIsa.versionMinor() == 1) {
+ const std::array<uint32_t, 1> gfx1010_equivalent = { 0 };
+ const std::array<uint32_t, 4> gfx1010_superset = { 0, 1, 2, 3 };
+ if (Contains(gfx1010_equivalent, codeObjectIsa.versionStepping()) &&
+ Contains(gfx1010_superset, agentIsa.versionStepping())) {
+ return true; // gfx1010 compatible object and agent
+ }
+ } else if (codeObjectIsa.versionMinor() == 3) {
+ return true; // gfx1030 compatible object and agent
+ }
+ }
+ }
+
+ return false;
+}
+
bool Isa::isCompatible(const Isa &codeObjectIsa, const Isa &agentIsa) {
- if (codeObjectIsa.versionMajor() != agentIsa.versionMajor() ||
- codeObjectIsa.versionMinor() != agentIsa.versionMinor() ||
- codeObjectIsa.versionStepping() != agentIsa.versionStepping())
+ if (!IsVersionCompatible(codeObjectIsa, agentIsa))
return false;
assert(codeObjectIsa.isSrameccSupported() == agentIsa.isSrameccSupported() &&

View file

@ -1,41 +0,0 @@
Backport of SWDEV-417691 - Error handling for MemoryMap OS calls.
The issue was fixed in rocclr 6.0.0.
https://github.com/ROCm/clr/commit/7a10423a44b8b353f67539dc1ae14c0b99c209b8
--- a/rocclr/os/os_posix.cpp
+++ b/rocclr/os/os_posix.cpp
@@ -214,7 +214,7 @@ address Os::reserveMemory(address start, size_t size, size_t alignment, MemProt
MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS, 0, 0);
// check for out of memory
- if (mem == NULL) return NULL;
+ if (mem == MAP_FAILED) return NULL;
address aligned = alignUp(mem, alignment);
@@ -842,7 +842,7 @@ bool Os::MemoryMapFileDesc(FileDesc fdesc, size_t fsize, size_t foffset, const v
}
*mmap_ptr = mmap(NULL, fsize, PROT_READ, MAP_SHARED, fdesc, foffset);
- return true;
+ return (*mmap_ptr == MAP_FAILED) ? false : true;
}
bool Os::MemoryUnmapFile(const void* mmap_ptr, size_t mmap_size) {
@@ -874,7 +874,7 @@ bool Os::MemoryMapFile(const char* fname, const void** mmap_ptr, size_t* mmap_si
close(fd);
- if (*mmap_ptr == nullptr) {
+ if (*mmap_ptr == MAP_FAILED) {
return false;
}
@@ -899,7 +899,7 @@ bool Os::MemoryMapFileTruncated(const char* fname, const void** mmap_ptr, size_t
close(fd);
- if (*mmap_ptr == nullptr) {
+ if (*mmap_ptr == MAP_FAILED) {
return false;
}

View file

@ -1,67 +0,0 @@
Fix SIGSEGV when compiled with avx-512 instructions.
Due to unaligned allocations, library crashes in
nontemporalMemcpy in _mm512_stream_si512 (which requires
64-aligned allocations, but used to copy default-aligned objects).
Without this patch hipamd causes random crashes in hipMemcpy* callers
(tensile, rocBLAS, miopen, rocThrust, etc.).
Bug: https://bugs.gentoo.org/915969
Bug report in upstream: https://github.com/ROCm-Developer-Tools/clr/issues/18
--- a/rocclr/device/rocm/rocvirtual.cpp
+++ b/rocclr/device/rocm/rocvirtual.cpp
@@ -2790,44 +2790,6 @@ bool VirtualGPU::createVirtualQueue(uint deviceQueueSize)
return true;
}
-// ================================================================================================
-__attribute__((optimize("unroll-all-loops"), always_inline))
-static inline void nontemporalMemcpy(void* __restrict dst, const void* __restrict src,
- uint16_t size) {
- #if defined(__AVX512F__)
- for (auto i = 0u; i != size / sizeof(__m512i); ++i) {
- _mm512_stream_si512(reinterpret_cast<__m512i* __restrict&>(dst)++,
- *reinterpret_cast<const __m512i* __restrict&>(src)++);
- }
- size = size % sizeof(__m512i);
- #endif
-
- #if defined(__AVX__)
- for (auto i = 0u; i != size / sizeof(__m256i); ++i) {
- _mm256_stream_si256(reinterpret_cast<__m256i* __restrict&>(dst)++,
- *reinterpret_cast<const __m256i* __restrict&>(src)++);
- }
- size = size % sizeof(__m256i);
- #endif
-
- for (auto i = 0u; i != size / sizeof(__m128i); ++i) {
- _mm_stream_si128(reinterpret_cast<__m128i* __restrict&>(dst)++,
- *(reinterpret_cast<const __m128i* __restrict&>(src)++));
- }
- size = size % sizeof(__m128i);
-
- for (auto i = 0u; i != size / sizeof(long long); ++i) {
- _mm_stream_si64(reinterpret_cast<long long* __restrict&>(dst)++,
- *reinterpret_cast<const long long* __restrict&>(src)++);
- }
- size = size % sizeof(long long);
-
- for (auto i = 0u; i != size / sizeof(int); ++i) {
- _mm_stream_si32(reinterpret_cast<int* __restrict&>(dst)++,
- *reinterpret_cast<const int* __restrict&>(src)++);
- }
-}
-
// ================================================================================================
bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
const amd::Kernel& kernel, const_address parameters, void* eventHandle,
@@ -3096,7 +3058,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
argBuffer = reinterpret_cast<address>(allocKernArg(gpuKernel.KernargSegmentByteSize(),
gpuKernel.KernargSegmentAlignment()));
// Load all kernel arguments
- nontemporalMemcpy(argBuffer, parameters,
+ memcpy(argBuffer, parameters,
std::min(gpuKernel.KernargSegmentByteSize(),
signature.paramsSize()));
}

View file

@ -1,17 +0,0 @@
Donot install -asan documents.
Reference:
https://github.com/RadeonOpenCompute/llvm-project/commit/e782e09f7b113a0f896c6cec7240d411aca1d73f
https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/issues/61
--- a/hipamd/packaging/CMakeLists.txt 2023-11-18 23:25:45.000000000 +0800
+++ b/hipamd/packaging/CMakeLists.txt 2023-11-18 23:27:27.230354665 +0800
@@ -36,8 +36,6 @@
###Set License####
set(CPACK_RESOURCE_FILE_LICENSE ${hip_SOURCE_DIR}/LICENSE.txt)
install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT binary)
-# install license file in share/doc/hip-asan folder
-install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-asan COMPONENT asan)
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
#Begin binary files install
if(HIP_PLATFORM STREQUAL "amd" )

View file

@ -1,20 +0,0 @@
These files already installed by hipcc, which is a runtime dep
--- a/hipamd/CMakeLists.txt
+++ b/hipamd/CMakeLists.txt
@@ -401,16 +401,7 @@ if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
set(hipcc_bin ${hipcc_bin}.exe)
set(hipconfig_bin ${hipconfig_bin}.exe)
endif()
- if(EXISTS ${hipcc_bin} AND EXISTS ${hipconfig_bin})
- install(PROGRAMS ${hipcc_bin} DESTINATION bin)
- install(PROGRAMS ${hipconfig_bin} DESTINATION bin)
- endif()
endif()
- install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc DESTINATION bin)
- install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig DESTINATION bin)
- install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin)
- install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin)
- install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin)
if(WIN32)
install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)
install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)

View file

@ -1,24 +0,0 @@
Fix "basename" and "__cpu_mask" definitions for musl
Upstream PR: https://github.com/ROCm/clr/pull/83
--- a/rocclr/os/os.hpp
+++ b/rocclr/os/os.hpp
@@ -29,6 +29,7 @@
#if defined(__linux__)
#include <sched.h>
+#include <libgen.h>
#endif
#ifdef _WIN32
@@ -377,6 +378,10 @@ ALWAYSINLINE address Os::currentStackPtr() {
#if defined(__linux__)
+#ifndef __GLIBC__
+typedef unsigned long int __cpu_mask;
+#endif
+
inline void Os::ThreadAffinityMask::init() { CPU_ZERO(&mask_); }
inline void Os::ThreadAffinityMask::set(uint cpu) { CPU_SET(cpu, &mask_); }

View file

@ -1,25 +0,0 @@
Fix for: class template specialization of '__numeric_type' not in a namespace enclosing '__hip'
Backports https://github.com/ROCm/clr/pull/109
--- a/hipamd/include/hip/amd_detail/amd_math_functions.h
+++ b/hipamd/include/hip/amd_detail/amd_math_functions.h
@@ -41,19 +41,6 @@ THE SOFTWARE.
#include <stdint.h>
#endif // !defined(__HIPCC_RTC__)
-#if _LIBCPP_VERSION && __HIP__
-namespace std {
-template <>
-struct __numeric_type<_Float16>
-{
- static _Float16 __test(_Float16);
-
- typedef _Float16 type;
- static const bool value = true;
-};
-}
-#endif // _LIBCPP_VERSION
-
#pragma push_macro("__DEVICE__")
#pragma push_macro("__RETURN_TYPE")

View file

@ -1,30 +0,0 @@
Fix compilation with libc++ (ROCM/clr part)
--- a/hipamd/include/hip/amd_detail/amd_hip_runtime.h
+++ b/hipamd/include/hip/amd_detail/amd_hip_runtime.h
@@ -386,15 +386,26 @@ hc_get_workitem_absolute_id(int dim)
#pragma push_macro("__CUDA__")
#define __CUDA__
#include <__clang_cuda_math_forward_declares.h>
+// __clang_cuda_complex_builtins wants ::max
+#include <__clang_hip_math.h>
#include <__clang_cuda_complex_builtins.h>
// Workaround for using libc++ with HIP-Clang.
// The following headers requires clang include path before standard C++ include path.
// However libc++ include path requires to be before clang include path.
// To workaround this, we pass -isystem with the parent directory of clang include
// path instead of the clang include path itself.
+
+// libc++: <include/cuda_wrappers/complex> transitively includes <queue>, which uses __local
+#define ORIGINAL__LOCAL __local
+#undef __local
+
#include <include/cuda_wrappers/algorithm>
#include <include/cuda_wrappers/complex>
#include <include/cuda_wrappers/new>
+
+#define __local ORIGINAL__LOCAL
+#undef ORIGINAL__LOCAL
+
#undef __CUDA__
#pragma pop_macro("__CUDA__")
#endif // !_OPENMP || __HIP_ENABLE_CUDA_WRAPPER_FOR_OPENMP__

View file

@ -1,27 +0,0 @@
Fix compilation with libc++ (ROCm/HIP part)
--- a/include/hip/hip_runtime.h
+++ b/include/hip/hip_runtime.h
@@ -49,10 +49,6 @@ THE SOFTWARE.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
-
-#if __cplusplus > 199711L
-#include <thread>
-#endif
#endif // !defined(__HIPCC_RTC__)
#include <hip/hip_version.h>
@@ -67,6 +63,12 @@ THE SOFTWARE.
#endif
#if !defined(__HIPCC_RTC__)
+// libc++ transitively includes thread->string_view->cuda_wrappers/algorithm,
+// which uses __host__, which is included via hip runtime above
+#if __cplusplus > 199711L
+#include <thread>
+#endif
+
#include <hip/hip_runtime_api.h>
#include <hip/library_types.h>
#endif // !defined(__HIPCC_RTC__)

View file

@ -1,12 +0,0 @@
hipcc files are already installed by dev-util/hipcc, which is a runtime dep
--- a/hipamd/CMakeLists.txt
+++ b/hipamd/CMakeLists.txt
@@ -393,7 +393,7 @@ endif()
install(FILES ${PROJECT_BINARY_DIR}/include/hip/hip_version.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip)
-if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
+if (INSTALL_HIPCC AND NOT ${HIPCC_BIN_DIR} STREQUAL "")
file(TO_CMAKE_PATH "${HIPCC_BIN_DIR}" HIPCC_BIN_DIR)
if(EXISTS ${HIPCC_BIN_DIR})
install(PROGRAMS ${HIPCC_BIN_DIR}/${HIPCC_EXECUTABLE} DESTINATION bin)

View file

@ -1,17 +0,0 @@
Prevent HIP targets from adding -isystem /usr/include, which breaks <cmath>
--- a/hipamd/hip-config-amd.cmake.in
+++ b/hipamd/hip-config-amd.cmake.in
@@ -135,13 +135,11 @@ set_target_properties(hip::host PROPERTIES
set_target_properties(hip::amdhip64 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)
if(NOT WIN32)
set_target_properties(hip::device PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)
endif()

View file

@ -1,15 +0,0 @@
In Gentoo rocm_agent_enumerator is installed by rocminfo and is in PATH.
--- catch/CMakeLists.txt~ 2023-11-18 13:56:08.000000000 +0800
+++ catch/CMakeLists.txt 2023-11-18 13:59:28.136170638 +0800
@@ -182,9 +182,8 @@
# rocm_agent_enumerator
if(NOT DEFINED OFFLOAD_ARCH_STR
AND NOT DEFINED ENV{HCC_AMDGPU_TARGET}
- AND EXISTS "${ROCM_PATH}/bin/rocm_agent_enumerator"
AND HIP_PLATFORM STREQUAL "amd" AND UNIX)
- execute_process(COMMAND ${ROCM_PATH}/bin/rocm_agent_enumerator
+ execute_process(COMMAND rocm_agent_enumerator
OUTPUT_VARIABLE HIP_GPU_ARCH
RESULT_VARIABLE ROCM_AGENT_ENUM_RESULT)
# Trim out gfx000

View file

@ -1,28 +0,0 @@
https://github.com/ROCm/hip-tests/pull/443
From cb0140843a162f69c454e91cd994524423b39b8c Mon Sep 17 00:00:00 2001
From: Yiyang Wu <xgreenlandforwyy@gmail.com>
Date: Sun, 10 Dec 2023 21:57:14 +0800
Subject: [PATCH] -fallow-half-arguments-and-returns is not recognized by clang
Reference: https://reviews.llvm.org/D145345
Issue: https://github.com/ROCm/HIP/issues/3178
Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
---
catch/unit/deviceLib/CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/catch/unit/deviceLib/CMakeLists.txt b/catch/unit/deviceLib/CMakeLists.txt
index 0645def..3662cbd 100644
--- catch/unit/deviceLib/CMakeLists.txt
+++ catch/unit/deviceLib/CMakeLists.txt
@@ -171,7 +171,6 @@ if(${ARCH_CHECK} GREATER_EQUAL 0)
set_source_files_properties(unsafeAtomicAdd_NonCoherent_withunsafeflag.cc PROPERTIES COMPILE_OPTIONS "-munsafe-fp-atomics")
set_source_files_properties(unsafeAtomicAdd_Coherent_withnounsafeflag.cc PROPERTIES COMPILE_OPTIONS "-mno-unsafe-fp-atomics")
set_source_files_properties(unsafeAtomicAdd_NonCoherent_withnounsafeflag.cc PROPERTIES COMPILE_OPTIONS "-mno-unsafe-fp-atomics")
- set_source_files_properties(hipMathFunctions.cc PROPERTIES COMPILE_FLAGS "-Xclang -fallow-half-arguments-and-returns")
file(GLOB AtomicAdd_files *AtomicAdd_*_*.cc)
set_property(SOURCE ${AtomicAdd_files} PROPERTY COMPILE_FLAGS --save-temps)
file(GLOB unsafeAtomicAdd_files *unsafeAtomicAdd_*_*.cc)
--
2.42.0

View file

@ -1,43 +0,0 @@
In Gentoo rocm_agent_enumerator is installed by rocminfo and is in PATH.
Index: catch/CMakeLists.txt
===================================================================
--- catch.orig/CMakeLists.txt
+++ catch/CMakeLists.txt
@@ -55,9 +55,9 @@ endif()
message(STATUS "HIP_PATH: ${HIP_PATH}")
message(STATUS "ROCM_PATH: ${ROCM_PATH}")
-set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc${EXT}")
-set(CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc${EXT}")
-set(HIPCONFIG_EXECUTABLE "${HIP_PATH}/bin/hipconfig${EXT}")
+set(CMAKE_CXX_COMPILER "hipcc${EXT}")
+set(CMAKE_C_COMPILER "hipcc${EXT}")
+set(HIPCONFIG_EXECUTABLE "hipconfig${EXT}")
execute_process(COMMAND ${HIPCONFIG_EXECUTABLE} --version
OUTPUT_VARIABLE HIP_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -183,9 +183,8 @@ message(STATUS "CMAKE HIP ARCHITECTURES:
# OFFLOAD_ARCH_STR
# rocm_agent_enumerator
if(NOT DEFINED OFFLOAD_ARCH_STR
- AND EXISTS "${ROCM_PATH}/bin/rocm_agent_enumerator"
AND HIP_PLATFORM STREQUAL "amd" AND UNIX)
- execute_process(COMMAND "${ROCM_PATH}/bin/rocm_agent_enumerator"
+ execute_process(COMMAND "rocm_agent_enumerator"
OUTPUT_VARIABLE HIP_GPU_ARCH
RESULT_VARIABLE ROCM_AGENT_ENUM_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
Index: catch/hipTestMain/hip_test_context.cc
===================================================================
--- catch.orig/hipTestMain/hip_test_context.cc
+++ catch/hipTestMain/hip_test_context.cc
@@ -37,7 +37,7 @@ std::string TestContext::substringFound(
std::string TestContext::getCurrentArch() {
#if HT_LINUX
- const char* cmd = "/opt/rocm/bin/rocm_agent_enumerator | sort -u | xargs | sed -e 's/ /;/g'";
+ const char* cmd = "rocm_agent_enumerator | sort -u | xargs | sed -e 's/ /;/g'";
std::array<char, 1024> buffer;
std::string result;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);

View file

@ -1,24 +0,0 @@
Those tests requires >=clang-18 to support -amdgpu-kernarg-preload-count
index afdf8c4..28b0198 100644
--- a/unit/module/CMakeLists.txt
+++ b/unit/module/CMakeLists.txt
@@ -41,9 +41,6 @@ add_custom_target(copyKernel.s
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include --rocm-path=${ROCM_PATH})
if(UNIX)
-set(TEST_SRC
- ${TEST_SRC}
- hipKerArgOptimization.cc)
add_custom_target(copiousArgKernel.code
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
@@ -106,8 +103,4 @@ hip_add_exe_to_target(NAME ModuleTest
TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
add_dependencies(build_tests copyKernel.code copyKernel.s)
-if(UNIX)
-add_dependencies(build_tests copiousArgKernel.code copiousArgKernel0.code copiousArgKernel1.code copiousArgKernel2.code
-copiousArgKernel3.code copiousArgKernel16.code copiousArgKernel17.code)
endif()
-endif()
\ No newline at end of file

View file

@ -1,159 +0,0 @@
Fix musl errors:
* reinterpret_cast from 'std::nullptr_t' to 'void **' is not allowed
* error.h is GNU extension
Upstream PR: https://github.com/ROCm/hip-tests/pull/463
--- a/unit/rtc/headers/printf_common.h
+++ b/unit/rtc/headers/printf_common.h
@@ -30,7 +30,6 @@ THE SOFTWARE.
#if defined(_WIN32)
#include <io.h>
#else
-#include <error.h>
#include <unistd.h>
#endif
@@ -110,7 +109,7 @@ struct CaptureStream {
saved_fd = dup(orig_fd);
if ((temp_fd = mkstemp(tempname)) == -1) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
}
@@ -118,11 +117,11 @@ struct CaptureStream {
void Begin() {
fflush(nullptr);
if (dup2(temp_fd, orig_fd) == -1) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
if (close(temp_fd) != 0) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
}
@@ -130,11 +129,11 @@ struct CaptureStream {
void End() {
fflush(nullptr);
if (dup2(saved_fd, orig_fd) == -1) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
if (close(saved_fd) != 0) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
}
@@ -148,7 +147,7 @@ struct CaptureStream {
~CaptureStream() {
if (remove(tempname) != 0) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
}
--- a/unit/memory/hipMemRangeGetAttributes_old.cc
+++ b/unit/memory/hipMemRangeGetAttributes_old.cc
@@ -268,7 +268,7 @@ TEST_CASE("Unit_hipMemRangeGetAttributes_NegativeTst") {
// Passing NULL as first parameter
SECTION("Passing NULL as first parameter") {
if (!CheckError(hipMemRangeGetAttributes(
- reinterpret_cast<void**>(NULL),
+ static_cast<void**>(NULL),
reinterpret_cast<size_t*>(dataSizes),
AttrArr, 4, Hmm, MEM_SIZE),
__LINE__)) {
--- a/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc
+++ b/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc
@@ -40,7 +40,7 @@ TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative") {
ret = hipOccupancyMaxActiveBlocksPerMultiprocessor(NULL, f1, blockSize, 0);
REQUIRE(ret != hipSuccess);
- ret = hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, NULL, blockSize, 0);
+ ret = hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, static_cast<void*>(NULL), blockSize, 0);
REQUIRE(ret != hipSuccess);
ret = hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, f1, 0, 0);
--- a/unit/occupancy/hipOccupancyMaxPotentialBlockSize_old.cc
+++ b/unit/occupancy/hipOccupancyMaxPotentialBlockSize_old.cc
@@ -37,7 +37,7 @@ TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_Negative") {
#ifndef __HIP_PLATFORM_NVIDIA__
// nvcc doesnt support kernelfunc(NULL) for api
- ret = hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, NULL, 0, 0);
+ ret = hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, static_cast<void*>(NULL), 0, 0);
REQUIRE(ret != hipSuccess);
#endif
}
--- a/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor.cc
+++ b/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor.cc
@@ -48,7 +48,7 @@ TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters
blockSize);
SECTION("Kernel function is NULL") {
- HIP_CHECK_ERROR(hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, NULL, blockSize, 0),
+ HIP_CHECK_ERROR(hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, static_cast<void*>(NULL), blockSize, 0),
hipErrorInvalidDeviceFunction);
}
}
--- a/unit/kernel/printf_common.h
+++ b/unit/kernel/printf_common.h
@@ -24,7 +24,6 @@ THE SOFTWARE.
#define _STRESSTEST_PRINTF_COMMON_H_
#include <errno.h>
-#include <error.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -47,17 +46,17 @@ struct CaptureStream {
saved_fd = dup(orig_fd);
if ((temp_fd = mkstemp(tempname)) == -1) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
fflush(nullptr);
if (dup2(temp_fd, orig_fd) == -1) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
if (close(temp_fd) != 0) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
}
@@ -67,11 +66,11 @@ struct CaptureStream {
return;
fflush(nullptr);
if (dup2(saved_fd, orig_fd) == -1) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
if (close(saved_fd) != 0) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
saved_fd = -1;
@@ -90,7 +89,7 @@ struct CaptureStream {
~CaptureStream() {
restoreStream();
if (remove(tempname) != 0) {
- error(0, errno, "Error");
+ fprintf(stderr, "Error: %s\n", strerror(errno));
assert(false);
}
}

View file

@ -1,12 +0,0 @@
In Gentoo rocm_agent_enumerator is installed by rocminfo and is in PATH.
--- a/hipTestMain/hip_test_context.cc
+++ b/hipTestMain/hip_test_context.cc
@@ -37,7 +37,7 @@ std::string TestContext::substringFound(
std::string TestContext::getCurrentArch() {
#if HT_LINUX
- const char* cmd = "/opt/rocm/bin/rocm_agent_enumerator | sort -u | xargs | sed -e 's/ /;/g'";
+ const char* cmd = "rocm_agent_enumerator | sort -u | xargs | sed -e 's/ /;/g'";
std::array<char, 1024> buffer;
std::string result;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);

View file

@ -1,182 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DOCS_BUILDER="doxygen"
DOCS_DEPEND="media-gfx/graphviz"
ROCM_SKIP_GLOBALS=1
inherit cmake docs flag-o-matic llvm rocm
LLVM_MAX_SLOT=17
TEST_PV=5.7.0 # No hip-test-5.7.1 release
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm/hipamd"
SRC_URI="https://github.com/ROCm/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz
https://github.com/ROCm/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz
test? ( https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-${TEST_PV}.tar.gz )"
KEYWORDS="~amd64"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
RESTRICT="!test? ( test )"
IUSE="debug test"
DEPEND="
=dev-util/rocminfo-5*
llvm-core/clang:${LLVM_MAX_SLOT}
dev-libs/rocm-comgr:${SLOT}
>=dev-libs/rocr-runtime-5.6
<dev-libs/rocr-runtime-6
x11-base/xorg-proto
virtual/opengl
"
BDEPEND="test? ( =dev-util/hipcc-5* )"
RDEPEND="${DEPEND}
=dev-util/hipcc-5*
dev-perl/URI-Encode
llvm-core/clang-runtime:=
>=dev-libs/roct-thunk-interface-5"
PATCHES=(
"${FILESDIR}/${PN}-5.7.0-install.patch"
"${FILESDIR}/${PN}-5.7.1-fix-unaligned-access.patch"
"${FILESDIR}/${PN}-5.7.1-exec-stack.patch"
"${FILESDIR}/${PN}-5.7.1-disable-stack-protector.patch"
"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
"${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
"${FILESDIR}/${PN}-5.7.1-fix-mmap-oom-check.patch"
)
S="${WORKDIR}/clr-rocm-${PV}/"
TEST_S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch"
hip_test_wrapper() {
local CMAKE_USE_DIR="${TEST_S}"
local BUILD_DIR="${TEST_S}_build"
cd "${TEST_S}" || die
$@
}
src_prepare() {
# Set HIP and HIP Clang paths directly, don't search using heuristics
sed -e "s:# Search for HIP installation:set(HIP_ROOT_DIR \"${EPREFIX}/usr\"):" \
-e "s:#Set HIP_CLANG_PATH:set(HIP_CLANG_PATH \"$(get_llvm_prefix -d ${LLVM_MAX_SLOT})/bin\"):" \
-i "${WORKDIR}"/HIP-rocm-${PV}/cmake/FindHIP.cmake || die
# https://github.com/ROCm/HIP/commit/405d029422ba8bb6be5a233d5eebedd2ad2e8bd3
# https://github.com/ROCm/clr/commit/ab6d34ae773f4d151e04170c0f4e46c1135ddf3e
# Migrated to hip-test, but somehow the change is not applied to the tarball.
rm -rf "${WORKDIR}"/HIP-rocm-${PV}/tests || die
sed -e '/tests.*cmake/d' -i hipamd/CMakeLists.txt || die
cmake_src_prepare
if use test; then
local PATCHES=(
"${FILESDIR}"/hip-test-5.7.0-rocm_agent_enumerator-location.patch \
"${FILESDIR}"/hip-test-5.7.1-remove-incompatible-flag.patch
)
hip_test_wrapper cmake_src_prepare
fi
}
src_configure() {
# -Werror=strict-aliasing
# https://bugs.gentoo.org/858383
# https://github.com/ROCm/clr/issues/64
#
# Do not trust it for LTO either
append-flags -fno-strict-aliasing
filter-lto
# Workaround for bug #923986
append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
use debug && CMAKE_BUILD_TYPE="Debug"
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
-DCMAKE_BUILD_TYPE=${buildtype}
-DCMAKE_SKIP_RPATH=ON
-DBUILD_HIPIFY_CLANG=OFF
-DHIP_PLATFORM=amd
-DHIP_COMMON_DIR="${WORKDIR}/HIP-rocm-${PV}"
-DROCM_PATH="${EPREFIX}/usr"
-DUSE_PROF_API=0
-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
-DCLR_BUILD_HIP=ON
-DHIPCC_BIN_DIR="${EPREFIX}/usr/bin"
-DOpenGL_GL_PREFERENCE="GLVND"
)
cmake_src_configure
if use test; then
local mycmakeargs=(
-DROCM_PATH="${BUILD_DIR}"/hipamd
-DHIP_PLATFORM=amd
-DCMAKE_MODULE_PATH="${TEST_S}/external/Catch2/cmake/Catch2"
)
hip_test_wrapper cmake_src_configure
fi
}
src_compile() {
cmake_src_compile
if use test; then
HIP_PATH="${BUILD_DIR}"/hipamd \
hip_test_wrapper cmake_src_compile build_tests
fi
}
src_test() {
check_amdgpu
export LD_LIBRARY_PATH="${BUILD_DIR}/hipamd/lib"
# TODO: research how to test Vulkan-related features.
local CMAKE_SKIP_TESTS=(
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters
Unit_hipImportExternalMemory_Vulkan_Negative_Parameters
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters
Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters
)
MAKEOPTS="-j1" hip_test_wrapper cmake_src_test
}
src_install() {
cmake_src_install
# add version file that is required by some libraries
mkdir "${ED}"/usr/include/rocm-core || die
cat <<EOF > "${ED}"/usr/include/rocm-core/rocm_version.h || die
#pragma once
#define ROCM_VERSION_MAJOR $(ver_cut 1)
#define ROCM_VERSION_MINOR $(ver_cut 2)
#define ROCM_VERSION_PATCH $(ver_cut 3)
#define ROCM_BUILD_INFO "$(ver_cut 1-3).0-9999-unknown"
EOF
dosym -r /usr/include/rocm-core/rocm_version.h /usr/include/rocm_version.h
rm "${ED}/usr/include/hip/hcc_detail" || die
# files already installed by hipcc, which is a runtime dep
rm "${ED}/usr/bin/hipconfig.pl" || die
rm "${ED}/usr/bin/hipcc.pl" || die
rm "${ED}/usr/bin/hipcc" || die
rm "${ED}/usr/bin/hipconfig" || die
rm "${ED}/usr/bin/hipvars.pm" || die
}

View file

@ -1,244 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DOCS_BUILDER="doxygen"
DOCS_DEPEND="media-gfx/graphviz"
ROCM_SKIP_GLOBALS=1
LLVM_COMPAT=( 20 )
inherit cmake docs flag-o-matic llvm-r1 rocm
TEST_PV=${PV}
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm/clr"
SRC_URI="
https://github.com/ROCm/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz
https://github.com/ROCm/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz
test? (
https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-${TEST_PV}.tar.gz -> hip-test-${TEST_PV}.tar.gz
)
"
S="${WORKDIR}/clr-rocm-${PV}/"
TEST_S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="debug +hip opencl test video_cards_amdgpu video_cards_nvidia"
RESTRICT="!test? ( test )"
REQUIRED_USE="
|| ( hip opencl )
^^ ( video_cards_amdgpu video_cards_nvidia )
"
DEPEND="
video_cards_amdgpu? (
>=dev-util/rocminfo-5
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}
')
dev-libs/rocm-comgr:${SLOT}
dev-libs/rocr-runtime:${SLOT}
)
video_cards_nvidia? (
dev-libs/hipother:${SLOT}
)
x11-base/xorg-proto
virtual/opengl
"
BDEPEND="
video_cards_amdgpu? (
dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
)
"
RDEPEND="${DEPEND}
llvm-core/clang-runtime:=
opencl? (
!dev-libs/opencl-icd-loader
!dev-libs/rocm-opencl-runtime
!dev-util/clinfo
!dev-util/opencl-headers
)
video_cards_amdgpu? (
dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
>=dev-libs/rocm-device-libs-${PV}
>=dev-libs/roct-thunk-interface-5
)
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
"${FILESDIR}/${PN}-6.1.0-install.patch"
"${FILESDIR}/${PN}-6.1.1-fix-musl.patch"
)
hip_test_wrapper() {
local CMAKE_USE_DIR="${TEST_S}"
local BUILD_DIR="${TEST_S}_build"
cd "${TEST_S}" || die
"${@}"
}
src_prepare() {
# NOTE We do this head stand to safe the patch size.
# NOTE Adjust when we drop 5.7.1
sed \
-e 's:kAmdgcnTargetTriple:AMDGCN_TARGET_TRIPLE:g' \
-i hipamd/src/hip_code_object.cpp || die
eapply "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
sed \
-e 's:AMDGCN_TARGET_TRIPLE:kAmdgcnTargetTriple:g' \
-i hipamd/src/hip_code_object.cpp || die
# hipamd is itself built by cmake, and should never provide a
# FindHIP.cmake module. But the reality is some package relies on it.
# Set HIP and HIP Clang paths directly, don't search using heuristics
sed -e "s:# Search for HIP installation:set(HIP_ROOT_DIR \"${EPREFIX}/usr\"):" \
-e "s:#Set HIP_CLANG_PATH:set(HIP_CLANG_PATH \"$(get_llvm_prefix -d)/bin\"):" \
-i "${WORKDIR}/HIP-rocm-${PV}/cmake/FindHIP.cmake" || die
cmake_src_prepare
# With Clang>17 -amdgpu-early-inline-all=true causes OOMs in dependencies
# https://github.com/llvm/llvm-project/issues/86332
if [ "$LLVM_SLOT" -le "17" ]; then
sed -e "s/-mllvm=-amdgpu-early-inline-all=true //" -i hipamd/hip-config-amd.cmake || die
sed -e "s/-mllvm=-amdgpu-early-inline-all=true;//" -i "${WORKDIR}/HIP-rocm-${PV}/hip-lang-config.cmake.in"
fi
if use test; then
local PATCHES=(
"${FILESDIR}"/hip-test-6.0.2-hipcc-system-install.patch
"${FILESDIR}"/hip-test-5.7.1-remove-incompatible-flag.patch
"${FILESDIR}"/hip-test-6.1.0-disable-hipKerArgOptimization.patch
"${FILESDIR}"/hip-test-6.1.1-fix-musl.patch
)
hip_test_wrapper cmake_src_prepare
fi
}
src_configure() {
# -Werror=strict-aliasing
# https://bugs.gentoo.org/858383
# https://github.com/ROCm/clr/issues/64
#
# Do not trust it for LTO either
append-flags -fno-strict-aliasing
filter-lto
use debug && CMAKE_BUILD_TYPE="Debug"
# Fix ld.lld linker error: https://github.com/ROCm/HIP/issues/3382
# See also: https://github.com/gentoo/gentoo/pull/29097
append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix)"
-DCMAKE_SKIP_RPATH=ON
-D__HIP_ENABLE_PCH="no"
-DCLR_BUILD_HIP="$(usex hip)"
-DCLR_BUILD_OCL="$(usex opencl)"
-DHIP_COMMON_DIR="${WORKDIR}/HIP-rocm-${PV}"
-DHIPCC_BIN_DIR="${EPREFIX}/usr/bin"
-DROCM_PATH="${EPREFIX}/usr"
-DUSE_PROF_API="no"
-DFILE_REORG_BACKWARD_COMPATIBILITY="no"
-DOpenGL_GL_PREFERENCE="GLVND"
-DCMAKE_DISABLE_FIND_PACKAGE_Git="yes"
)
if use video_cards_amdgpu; then
mycmakeargs+=(
-DHIP_PLATFORM="amd"
)
elif use video_cards_nvidia; then
mycmakeargs+=(
-DHIPNV_DIR="${EPREFIX}/usr"
-DHIP_PLATFORM="nvidia"
)
fi
cmake_src_configure
if use test; then
local mycmakeargs=(
-DCMAKE_MODULE_PATH="${TEST_S}/external/Catch2/cmake/Catch2"
)
if use video_cards_amdgpu; then
mycmakeargs+=(
-DROCM_PATH="${BUILD_DIR}/hipamd"
-DHIP_PLATFORM="amd"
)
elif use video_cards_nvidia; then
mycmakeargs+=(
-DROCM_PATH="${BUILD_DIR}/hipother"
-DHIP_PLATFORM="nvidia"
)
fi
HIP_PATH="${EPREFIX}/usr" hip_test_wrapper cmake_src_configure
fi
}
src_compile() {
cmake_src_compile
if use test; then
HIP_PATH="${BUILD_DIR}"/hipamd \
hip_test_wrapper cmake_src_compile build_tests
fi
}
src_test() {
check_amdgpu
export LD_LIBRARY_PATH="${BUILD_DIR}/hipamd/lib"
# TODO: research how to test Vulkan-related features.
local CMAKE_SKIP_TESTS=(
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters
Unit_hipImportExternalMemory_Vulkan_Negative_Parameters
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters
Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters
)
MAKEOPTS="-j1" hip_test_wrapper cmake_src_test
}
src_install() {
cmake_src_install
# add version file that is required by some libraries
mkdir "${ED}"/usr/include/rocm-core || die
cat <<-EOF > "${ED}"/usr/include/rocm-core/rocm_version.h || die
#pragma once
#define ROCM_VERSION_MAJOR $(ver_cut 1)
#define ROCM_VERSION_MINOR $(ver_cut 2)
#define ROCM_VERSION_PATCH $(ver_cut 3)
#define ROCM_BUILD_INFO "$(ver_cut 1-3).0-9999-unknown"
EOF
dosym -r /usr/include/rocm-core/rocm_version.h /usr/include/rocm_version.h
if use video_cards_nvidia; then
newenvd - 99hipconfig <<-EOF
HIP_PLATFORM="nvidia"
HIP_RUNTIME="cuda"
CUDA_PATH="${EPREFIX}/opt/cuda"
EOF
fi
}

View file

@ -1,244 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DOCS_BUILDER="doxygen"
DOCS_DEPEND="media-gfx/graphviz"
ROCM_SKIP_GLOBALS=1
LLVM_COMPAT=( 20 )
inherit cmake docs flag-o-matic llvm-r1 rocm
TEST_PV=${PV}
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm/clr"
SRC_URI="
https://github.com/ROCm/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz
https://github.com/ROCm/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz
test? (
https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-${TEST_PV}.tar.gz -> hip-test-${TEST_PV}.tar.gz
)
"
S="${WORKDIR}/clr-rocm-${PV}/"
TEST_S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="debug +hip opencl test video_cards_amdgpu video_cards_nvidia"
RESTRICT="!test? ( test )"
REQUIRED_USE="
|| ( hip opencl )
^^ ( video_cards_amdgpu video_cards_nvidia )
"
DEPEND="
video_cards_amdgpu? (
dev-util/rocminfo:${SLOT}
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}
')
dev-libs/rocm-comgr:${SLOT}
dev-libs/rocr-runtime:${SLOT}
)
video_cards_nvidia? (
dev-libs/hipother:${SLOT}
)
x11-base/xorg-proto
virtual/opengl
"
BDEPEND="
video_cards_amdgpu? (
dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
)
"
RDEPEND="${DEPEND}
llvm-core/clang-runtime:=
opencl? (
!dev-libs/opencl-icd-loader
!dev-libs/rocm-opencl-runtime
!dev-util/clinfo
!dev-util/opencl-headers
)
video_cards_amdgpu? (
dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
dev-libs/rocm-device-libs:${SLOT}
dev-libs/roct-thunk-interface:${SLOT}
)
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
"${FILESDIR}/${PN}-6.1.0-install.patch"
"${FILESDIR}/${PN}-6.1.1-fix-musl.patch"
)
hip_test_wrapper() {
local CMAKE_USE_DIR="${TEST_S}"
local BUILD_DIR="${TEST_S}_build"
cd "${TEST_S}" || die
"${@}"
}
src_prepare() {
# NOTE We do this head stand to safe the patch size.
# NOTE Adjust when we drop 5.7.1
sed \
-e 's:kAmdgcnTargetTriple:AMDGCN_TARGET_TRIPLE:g' \
-i hipamd/src/hip_code_object.cpp || die
eapply "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
sed \
-e 's:AMDGCN_TARGET_TRIPLE:kAmdgcnTargetTriple:g' \
-i hipamd/src/hip_code_object.cpp || die
# hipamd is itself built by cmake, and should never provide a
# FindHIP.cmake module. But the reality is some package relies on it.
# Set HIP and HIP Clang paths directly, don't search using heuristics
sed -e "s:# Search for HIP installation:set(HIP_ROOT_DIR \"${EPREFIX}/usr\"):" \
-e "s:#Set HIP_CLANG_PATH:set(HIP_CLANG_PATH \"$(get_llvm_prefix -d)/bin\"):" \
-i "${WORKDIR}/HIP-rocm-${PV}/cmake/FindHIP.cmake" || die
cmake_src_prepare
# With Clang>17 -amdgpu-early-inline-all=true causes OOMs in dependencies
# https://github.com/llvm/llvm-project/issues/86332
if [ "$LLVM_SLOT" -le "17" ]; then
sed -e "s/-mllvm=-amdgpu-early-inline-all=true //" -i hipamd/hip-config-amd.cmake || die
sed -e "s/-mllvm=-amdgpu-early-inline-all=true;//" -i "${WORKDIR}/HIP-rocm-${PV}/hip-lang-config.cmake.in"
fi
if use test; then
local PATCHES=(
"${FILESDIR}"/hip-test-6.0.2-hipcc-system-install.patch
"${FILESDIR}"/hip-test-5.7.1-remove-incompatible-flag.patch
"${FILESDIR}"/hip-test-6.1.0-disable-hipKerArgOptimization.patch
"${FILESDIR}"/hip-test-6.1.1-fix-musl.patch
)
hip_test_wrapper cmake_src_prepare
fi
}
src_configure() {
# -Werror=strict-aliasing
# https://bugs.gentoo.org/858383
# https://github.com/ROCm/clr/issues/64
#
# Do not trust it for LTO either
append-flags -fno-strict-aliasing
filter-lto
use debug && CMAKE_BUILD_TYPE="Debug"
# Fix ld.lld linker error: https://github.com/ROCm/HIP/issues/3382
# See also: https://github.com/gentoo/gentoo/pull/29097
append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix)"
-DCMAKE_SKIP_RPATH=ON
-D__HIP_ENABLE_PCH="no"
-DCLR_BUILD_HIP="$(usex hip)"
-DCLR_BUILD_OCL="$(usex opencl)"
-DHIP_COMMON_DIR="${WORKDIR}/HIP-rocm-${PV}"
-DHIPCC_BIN_DIR="${EPREFIX}/usr/bin"
-DROCM_PATH="${EPREFIX}/usr"
-DUSE_PROF_API="no"
-DFILE_REORG_BACKWARD_COMPATIBILITY="no"
-DOpenGL_GL_PREFERENCE="GLVND"
-DCMAKE_DISABLE_FIND_PACKAGE_Git="yes"
)
if use video_cards_amdgpu; then
mycmakeargs+=(
-DHIP_PLATFORM="amd"
)
elif use video_cards_nvidia; then
mycmakeargs+=(
-DHIPNV_DIR="${EPREFIX}/usr"
-DHIP_PLATFORM="nvidia"
)
fi
cmake_src_configure
if use test; then
local mycmakeargs=(
-DCMAKE_MODULE_PATH="${TEST_S}/external/Catch2/cmake/Catch2"
)
if use video_cards_amdgpu; then
mycmakeargs+=(
-DROCM_PATH="${BUILD_DIR}/hipamd"
-DHIP_PLATFORM="amd"
)
elif use video_cards_nvidia; then
mycmakeargs+=(
-DROCM_PATH="${BUILD_DIR}/hipother"
-DHIP_PLATFORM="nvidia"
)
fi
HIP_PATH="${EPREFIX}/usr" hip_test_wrapper cmake_src_configure
fi
}
src_compile() {
cmake_src_compile
if use test; then
HIP_PATH="${BUILD_DIR}"/hipamd \
hip_test_wrapper cmake_src_compile build_tests
fi
}
src_test() {
check_amdgpu
export LD_LIBRARY_PATH="${BUILD_DIR}/hipamd/lib"
# TODO: research how to test Vulkan-related features.
local CMAKE_SKIP_TESTS=(
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters
Unit_hipImportExternalMemory_Vulkan_Negative_Parameters
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters
Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters
)
MAKEOPTS="-j1" hip_test_wrapper cmake_src_test
}
src_install() {
cmake_src_install
# add version file that is required by some libraries
mkdir "${ED}"/usr/include/rocm-core || die
cat <<-EOF > "${ED}"/usr/include/rocm-core/rocm_version.h || die
#pragma once
#define ROCM_VERSION_MAJOR $(ver_cut 1)
#define ROCM_VERSION_MINOR $(ver_cut 2)
#define ROCM_VERSION_PATCH $(ver_cut 3)
#define ROCM_BUILD_INFO "$(ver_cut 1-3).0-9999-unknown"
EOF
dosym -r /usr/include/rocm-core/rocm_version.h /usr/include/rocm_version.h
if use video_cards_nvidia; then
newenvd - 99hipconfig <<-EOF
HIP_PLATFORM="nvidia"
HIP_RUNTIME="cuda"
CUDA_PATH="${EPREFIX}/opt/cuda"
EOF
fi
}

View file

@ -1,255 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DOCS_BUILDER="doxygen"
DOCS_DEPEND="media-gfx/graphviz"
ROCM_SKIP_GLOBALS=1
LLVM_COMPAT=( 20 )
inherit cmake docs flag-o-matic llvm-r1 rocm
TEST_PV=${PV}
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm/clr"
SRC_URI="
https://github.com/ROCm/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz
https://github.com/ROCm/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz
test? (
https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-${TEST_PV}.tar.gz -> hip-test-${TEST_PV}.tar.gz
)
"
S="${WORKDIR}/clr-rocm-${PV}/"
TEST_S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch"
HIP_S="${WORKDIR}/HIP-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="debug +hip opencl test video_cards_amdgpu video_cards_nvidia"
# some tests are broken
RESTRICT="test"
REQUIRED_USE="
|| ( hip opencl )
^^ ( video_cards_amdgpu video_cards_nvidia )
"
DEPEND="
video_cards_amdgpu? (
dev-util/rocminfo:${SLOT}
dev-libs/rocm-comgr:${SLOT}
dev-libs/rocr-runtime:${SLOT}
)
video_cards_nvidia? (
dev-libs/hipother:${SLOT}
)
x11-base/xorg-proto
virtual/opengl
"
BDEPEND="
video_cards_amdgpu? (
dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
)
test? (
media-libs/freeglut
)
"
RDEPEND="${DEPEND}
opencl? (
!dev-libs/opencl-icd-loader
!dev-libs/rocm-opencl-runtime
!dev-util/clinfo
!dev-util/opencl-headers
)
video_cards_amdgpu? (
dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
dev-libs/rocm-device-libs:${SLOT}
dev-libs/roct-thunk-interface:${SLOT}
)
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
"${FILESDIR}/${PN}-6.3.0-install.patch"
"${FILESDIR}/${PN}-6.1.1-fix-musl.patch"
"${FILESDIR}/${PN}-6.2.4-libcxx.patch"
"${FILESDIR}/${PN}-6.3.0-no-isystem-usr-include.patch"
"${FILESDIR}/${PN}-6.3.0-clr-fix-libcxx.patch"
)
hip_test_wrapper() {
local CMAKE_USE_DIR="${TEST_S}"
local BUILD_DIR="${TEST_S}_build"
cd "${TEST_S}" || die
"${@}"
}
src_prepare() {
# NOTE We do this head stand to safe the patch size.
# NOTE Adjust when we drop 5.7.1
sed \
-e 's:kAmdgcnTargetTriple:AMDGCN_TARGET_TRIPLE:g' \
-i hipamd/src/hip_code_object.cpp || die
eapply "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
sed \
-e 's:AMDGCN_TARGET_TRIPLE:kAmdgcnTargetTriple:g' \
-i hipamd/src/hip_code_object.cpp || die
pushd "${HIP_S}" >/dev/null || die
eapply "${FILESDIR}/${PN}-6.3.0-hip-fix-libcxx.patch"
# hipamd is itself built by cmake, and should never provide a
# FindHIP.cmake module. But the reality is some package relies on it.
# Set HIP and HIP Clang paths directly, don't search using heuristics
sed -e "s:# Search for HIP installation:set(HIP_ROOT_DIR \"${EPREFIX}/usr\"):" \
-e "s:#Set HIP_CLANG_PATH:set(HIP_CLANG_PATH \"$(get_llvm_prefix -d)/bin\"):" \
-i "cmake/FindHIP.cmake" || die
popd >/dev/null || die
sed -e "s/ -Werror//g" -i "hipamd/src/CMakeLists.txt" || die
cmake_src_prepare
if use test; then
local PATCHES=(
"${FILESDIR}"/hip-test-6.3.0-hipcc-system-install.patch
"${FILESDIR}"/hip-test-5.7.1-remove-incompatible-flag.patch
"${FILESDIR}"/hip-test-6.1.1-fix-musl.patch
)
sed -e "s/-Werror //" -e "s/-Wall -Wextra //" -i "${TEST_S}/CMakeLists.txt" || die
hip_test_wrapper cmake_src_prepare
fi
}
src_configure() {
# -Werror=strict-aliasing
# https://bugs.gentoo.org/858383
# https://github.com/ROCm/clr/issues/64
#
# Do not trust it for LTO either
append-flags -fno-strict-aliasing
filter-lto
use debug && CMAKE_BUILD_TYPE="Debug"
# Fix ld.lld linker error: https://github.com/ROCm/HIP/issues/3382
# See also: https://github.com/gentoo/gentoo/pull/29097
append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix)"
-DCMAKE_SKIP_RPATH=ON
-D__HIP_ENABLE_PCH=OFF
-DCLR_BUILD_HIP="$(usex hip)"
-DCLR_BUILD_OCL="$(usex opencl)"
-DHIP_COMMON_DIR="${HIP_S}"
-DHIP_ENABLE_ROCPROFILER_REGISTER=OFF
-DHIPCC_BIN_DIR="${EPREFIX}/usr/bin"
-DROCM_PATH="${EPREFIX}/usr"
-DUSE_PROF_API=OFF
-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
-DOpenGL_GL_PREFERENCE="GLVND"
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
)
if use video_cards_amdgpu; then
mycmakeargs+=(
-DHIP_PLATFORM="amd"
)
elif use video_cards_nvidia; then
mycmakeargs+=(
-DHIPNV_DIR="${EPREFIX}/usr"
-DHIP_PLATFORM="nvidia"
)
fi
cmake_src_configure
if use test; then
local mycmakeargs=(
-DCMAKE_MODULE_PATH="${TEST_S}/external/Catch2/cmake/Catch2"
-DROCM_PATH="${EPREFIX}/usr"
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON
-Wno-dev
# 1) Use custom build of hipamd instead of system one
# 2) Build fails with libc++: https://github.com/llvm/llvm-project/issues/119076
-DCMAKE_CXX_FLAGS="-I${BUILD_DIR}/hipamd/include -stdlib=libstdc++"
-DCMAKE_EXE_LINKER_FLAGS="-L${BUILD_DIR}/hipamd/lib"
)
if use video_cards_amdgpu; then
mycmakeargs+=(
-DHIP_PLATFORM="amd"
)
elif use video_cards_nvidia; then
mycmakeargs+=(
-DHIP_PLATFORM="nvidia"
)
fi
hip_test_wrapper cmake_src_configure
fi
}
src_compile() {
cmake_src_compile
if use test; then
hip_test_wrapper cmake_src_compile build_tests
fi
}
src_test() {
check_amdgpu
export LD_LIBRARY_PATH="${BUILD_DIR}/hipamd/lib"
# TODO: research how to test Vulkan-related features.
local CMAKE_SKIP_TESTS=(
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters
Unit_hipImportExternalMemory_Vulkan_Negative_Parameters
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters
Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters
)
MAKEOPTS="-j1" hip_test_wrapper cmake_src_test
}
src_install() {
cmake_src_install
# add version file that is required by some libraries
mkdir "${ED}"/usr/include/rocm-core || die
cat <<-EOF > "${ED}"/usr/include/rocm-core/rocm_version.h || die
#pragma once
#define ROCM_VERSION_MAJOR $(ver_cut 1)
#define ROCM_VERSION_MINOR $(ver_cut 2)
#define ROCM_VERSION_PATCH $(ver_cut 3)
#define ROCM_BUILD_INFO "$(ver_cut 1-3).0-9999-unknown"
EOF
dosym -r /usr/include/rocm-core/rocm_version.h /usr/include/rocm_version.h
if use video_cards_nvidia; then
newenvd - 99hipconfig <<-EOF
HIP_PLATFORM="nvidia"
HIP_RUNTIME="cuda"
CUDA_PATH="${EPREFIX}/opt/cuda"
EOF
fi
}

View file

@ -1,255 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DOCS_BUILDER="doxygen"
DOCS_DEPEND="media-gfx/graphviz"
ROCM_SKIP_GLOBALS=1
LLVM_COMPAT=( 20 )
inherit cmake docs flag-o-matic llvm-r1 rocm
TEST_PV=${PV}
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm/clr"
SRC_URI="
https://github.com/ROCm/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz
https://github.com/ROCm/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz
test? (
https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-${TEST_PV}.tar.gz -> hip-test-${TEST_PV}.tar.gz
)
"
S="${WORKDIR}/clr-rocm-${PV}/"
TEST_S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch"
HIP_S="${WORKDIR}/HIP-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="debug +hip opencl test video_cards_amdgpu video_cards_nvidia"
# some tests are broken
RESTRICT="test"
REQUIRED_USE="
|| ( hip opencl )
^^ ( video_cards_amdgpu video_cards_nvidia )
"
DEPEND="
video_cards_amdgpu? (
dev-util/rocminfo:${SLOT}
dev-libs/rocm-comgr:${SLOT}
dev-libs/rocr-runtime:${SLOT}
)
video_cards_nvidia? (
dev-libs/hipother:${SLOT}
)
x11-base/xorg-proto
virtual/opengl
"
BDEPEND="
video_cards_amdgpu? (
dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
)
test? (
media-libs/freeglut
)
"
RDEPEND="${DEPEND}
opencl? (
!dev-libs/opencl-icd-loader
!dev-libs/rocm-opencl-runtime
!dev-util/clinfo
!dev-util/opencl-headers
)
video_cards_amdgpu? (
dev-util/hipcc:${SLOT}[${LLVM_USEDEP}]
dev-libs/rocm-device-libs:${SLOT}
dev-libs/roct-thunk-interface:${SLOT}
)
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
"${FILESDIR}/${PN}-6.3.0-install.patch"
"${FILESDIR}/${PN}-6.1.1-fix-musl.patch"
"${FILESDIR}/${PN}-6.2.4-libcxx.patch"
"${FILESDIR}/${PN}-6.3.0-no-isystem-usr-include.patch"
"${FILESDIR}/${PN}-6.3.0-clr-fix-libcxx.patch"
)
hip_test_wrapper() {
local CMAKE_USE_DIR="${TEST_S}"
local BUILD_DIR="${TEST_S}_build"
cd "${TEST_S}" || die
"${@}"
}
src_prepare() {
# NOTE We do this head stand to safe the patch size.
# NOTE Adjust when we drop 5.7.1
sed \
-e 's:kAmdgcnTargetTriple:AMDGCN_TARGET_TRIPLE:g' \
-i hipamd/src/hip_code_object.cpp || die
eapply "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
sed \
-e 's:AMDGCN_TARGET_TRIPLE:kAmdgcnTargetTriple:g' \
-i hipamd/src/hip_code_object.cpp || die
pushd "${HIP_S}" >/dev/null || die
eapply "${FILESDIR}/${PN}-6.3.0-hip-fix-libcxx.patch"
# hipamd is itself built by cmake, and should never provide a
# FindHIP.cmake module. But the reality is some package relies on it.
# Set HIP and HIP Clang paths directly, don't search using heuristics
sed -e "s:# Search for HIP installation:set(HIP_ROOT_DIR \"${EPREFIX}/usr\"):" \
-e "s:#Set HIP_CLANG_PATH:set(HIP_CLANG_PATH \"$(get_llvm_prefix -d)/bin\"):" \
-i "cmake/FindHIP.cmake" || die
popd >/dev/null || die
sed -e "s/ -Werror//g" -i "hipamd/src/CMakeLists.txt" || die
cmake_src_prepare
if use test; then
local PATCHES=(
"${FILESDIR}"/hip-test-6.3.0-hipcc-system-install.patch
"${FILESDIR}"/hip-test-5.7.1-remove-incompatible-flag.patch
"${FILESDIR}"/hip-test-6.1.1-fix-musl.patch
)
sed -e "s/-Werror //" -e "s/-Wall -Wextra //" -i "${TEST_S}/CMakeLists.txt" || die
hip_test_wrapper cmake_src_prepare
fi
}
src_configure() {
# -Werror=strict-aliasing
# https://bugs.gentoo.org/858383
# https://github.com/ROCm/clr/issues/64
#
# Do not trust it for LTO either
append-flags -fno-strict-aliasing
filter-lto
use debug && CMAKE_BUILD_TYPE="Debug"
# Fix ld.lld linker error: https://github.com/ROCm/HIP/issues/3382
# See also: https://github.com/gentoo/gentoo/pull/29097
append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix)"
-DCMAKE_SKIP_RPATH=ON
-D__HIP_ENABLE_PCH=OFF
-DCLR_BUILD_HIP="$(usex hip)"
-DCLR_BUILD_OCL="$(usex opencl)"
-DHIP_COMMON_DIR="${HIP_S}"
-DHIP_ENABLE_ROCPROFILER_REGISTER=OFF
-DHIPCC_BIN_DIR="${EPREFIX}/usr/bin"
-DROCM_PATH="${EPREFIX}/usr"
-DUSE_PROF_API=OFF
-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
-DOpenGL_GL_PREFERENCE="GLVND"
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
)
if use video_cards_amdgpu; then
mycmakeargs+=(
-DHIP_PLATFORM="amd"
)
elif use video_cards_nvidia; then
mycmakeargs+=(
-DHIPNV_DIR="${EPREFIX}/usr"
-DHIP_PLATFORM="nvidia"
)
fi
cmake_src_configure
if use test; then
local mycmakeargs=(
-DCMAKE_MODULE_PATH="${TEST_S}/external/Catch2/cmake/Catch2"
-DROCM_PATH="${EPREFIX}/usr"
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON
-Wno-dev
# 1) Use custom build of hipamd instead of system one
# 2) Build fails with libc++: https://github.com/llvm/llvm-project/issues/119076
-DCMAKE_CXX_FLAGS="-I${BUILD_DIR}/hipamd/include -stdlib=libstdc++"
-DCMAKE_EXE_LINKER_FLAGS="-L${BUILD_DIR}/hipamd/lib"
)
if use video_cards_amdgpu; then
mycmakeargs+=(
-DHIP_PLATFORM="amd"
)
elif use video_cards_nvidia; then
mycmakeargs+=(
-DHIP_PLATFORM="nvidia"
)
fi
hip_test_wrapper cmake_src_configure
fi
}
src_compile() {
cmake_src_compile
if use test; then
hip_test_wrapper cmake_src_compile build_tests
fi
}
src_test() {
check_amdgpu
export LD_LIBRARY_PATH="${BUILD_DIR}/hipamd/lib"
# TODO: research how to test Vulkan-related features.
local CMAKE_SKIP_TESTS=(
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write
Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters
Unit_hipImportExternalMemory_Vulkan_Negative_Parameters
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters
Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters
Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters
)
MAKEOPTS="-j1" hip_test_wrapper cmake_src_test
}
src_install() {
cmake_src_install
# add version file that is required by some libraries
mkdir "${ED}"/usr/include/rocm-core || die
cat <<-EOF > "${ED}"/usr/include/rocm-core/rocm_version.h || die
#pragma once
#define ROCM_VERSION_MAJOR $(ver_cut 1)
#define ROCM_VERSION_MINOR $(ver_cut 2)
#define ROCM_VERSION_PATCH $(ver_cut 3)
#define ROCM_BUILD_INFO "$(ver_cut 1-3).0-9999-unknown"
EOF
dosym -r /usr/include/rocm-core/rocm_version.h /usr/include/rocm_version.h
if use video_cards_nvidia; then
newenvd - 99hipconfig <<-EOF
HIP_PLATFORM="nvidia"
HIP_RUNTIME="cuda"
CUDA_PATH="${EPREFIX}/opt/cuda"
EOF
fi
}

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>sci@gentoo.org</email>
<name>Gentoo Science Project</name>
</maintainer>
<maintainer type="person">
<email>candrews@gentoo.org</email>
<name>Craig Andrews</name>
</maintainer>
<maintainer type="person" proxied="yes">
<email>xgreenlandforwyy@gmail.com</email>
<name>Yiyang Wu</name>
</maintainer>
<maintainer type="person" proxied="yes">
<email>gentoo@holzke.net</email>
<name>Wilfried Holzke</name>
</maintainer>
<maintainer type="person">
<email>lockalsash@gmail.com</email>
<name>Sv. Lockal</name>
</maintainer>
<upstream>
<remote-id type="github">ROCm/HIP</remote-id>
</upstream>
<use>
<flag name="hip">Build HIP runtime</flag>
<flag name="opencl">Build OpenCL runtime</flag>
<flag name="video_cards_amdgpu">Build for AMD platform</flag>
<flag name="video_cards_nvidia">Build for Nvidia platform</flag>
</use>
</pkgmetadata>

View file

@ -1,5 +0,0 @@
DIST hipcc-5.7.1.tar.gz 36589 BLAKE2B a8ae6bd9f0f985d78119223b67b5b35b8d1ee38edb7e43c1e77752d203fe2c8b669b3bcff0cec661054d8cb24f799e7784a49eb0664bdd1dc2bf024ce026c175 SHA512 2d232c8dd4a47de6e0cff9d37b4e63a26cb1809ef2ff3a119c15e992cae96ffc2f4d8c1ddffd8732dea3a3d589a93e177f424a6174f982908aa50904e265432a
DIST llvm-project-rocm-6.1.1.tar.gz 196027084 BLAKE2B 3ef0b6e3c47c66fd80289373e6ff8aaff44751f9b380addfae73a18dc388093c0535f230b0cc7528724bc43f6992e2ae6decd3d0d3c700893ca95a6166b7b8dc SHA512 e320d4eeaa6f61ed1cdbf653d67fe887d3ce9dc0d6743b4713502e1cb5318ab8afbe1ee71f8cba07635c54ce532df6683de40ade0e5be4a52e50ce25a9b70818
DIST llvm-project-rocm-6.1.2.tar.gz 195992927 BLAKE2B d821f29f2f1f7c1ff414c63a710281f16d2a394b21f3365d01b86710cc09ed27e514b49fb744bf6a36b38815afa56cc26d44f0238f38479a0c2db9bf9989f389 SHA512 5f7e5dbe5976141de35e96e603624bd9d5a2c08b0690ba9fcd81d1b32f540f94bb9f4b74539e2838fd60ae1312dbe5e0b429ba80a03871782cdf3bd834940ce0
DIST llvm-project-rocm-6.3.2.tar.gz 206671202 BLAKE2B a280e2be22b8eb9fd51814074447baed3637231d4bfbe391047a1fb2409197c8d8ba58cebb3aeaec15aa4daee9371311274b30ede48e0039d7c84e432b15de1a SHA512 314e27577af76268635f3c96ee3516829e4622913c3d0c4c68eccbaee0c9f7f5fc031cbd35827deb4bc29712592c424e296c15ce8c500c897bfb3eb19455899c
DIST llvm-project-rocm-6.3.3.tar.gz 206663912 BLAKE2B 939527dbbcd0c4b4785e5cdbd7144149f169120506c2b5b00e84e8208e3877109e24cf58501a1317d1f9dcce0614cf47a0290cb2e0e10aa7b164bcb064c2ffbc SHA512 380d6ca72dd215b1996b14fe9b54f4981bd1d275aae22ed89f4f3efc46ec2988054cc98dcc45e1c678812c2bd3488ed6cf375ca193af4ad272a6cff7f2388872

View file

@ -1,13 +0,0 @@
Related bug: https://bugs.gentoo.org/890377
--- a/bin/hipcc.pl
+++ b/bin/hipcc.pl
@@ -552,6 +552,9 @@ if ($buildDeps and $HIP_PLATFORM eq 'amd') {
# pass-through CPP mode.
if ($HIP_PLATFORM eq "amd") {
+ # Append -fno-stack-protector due to stack protection for HIP is not supported
+ $HIPCXXFLAGS .= " -fno-stack-protector";
+ $HIPCFLAGS .= " -fno-stack-protector";
# Set default optimization level to -O3 for hip-clang.
if ($optArg eq "") {
$HIPCXXFLAGS .= " -O3";

View file

@ -1,42 +0,0 @@
Edit from:
https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/759b0773bd848ff9471fa8cdecd9ee21010bc29c/debian/patches/0013-hipcc-hip-version.patch
`--hip-version` is required for correclty including __clang_hip_runtime_wrapper.h
=================================================================================
Description: enforce --hip-version option within hipcc call.
This change is needed since the normal mechanism in ROCm relies on
reading a .hipVersion hidden configuration file which has no proper
equivalent in a FHS compliant tree, as of ROCm 5.0.
Author: Cordell Bloor <cgmb-deb@slerp.xyz>
Bug: https://github.com/ROCm-Developer-Tools/HIP/pull/2937
Forwarded: not-needed
Reviewed-by: Étienne Mollier <emollier@debian.org>
Last-Update: 2022-07-04
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: HIP/bin/hipcc.pl
===================================================================
--- HIP.orig/bin/hipcc.pl
+++ HIP/bin/hipcc.pl
@@ -121,6 +121,9 @@ $HIP_PATH = $hipvars::HIP_PATH;
$ROCM_PATH = $hipvars::ROCM_PATH;
$HIP_VERSION = $hipvars::HIP_VERSION;
$HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME;
+$HIP_VERSION_MAJOR = $hipvars::HIP_VERSION_MAJOR;
+$HIP_VERSION_MINOR = $hipvars::HIP_VERSION_MINOR;
+$HIP_VERSION_PATCH = $hipvars::HIP_VERSION_PATCH;
if ($HIP_PLATFORM eq "amd") {
$HIP_INCLUDE_PATH = "$HIP_ROCCLR_HOME/include";
@@ -188,6 +191,12 @@ if ($HIP_PLATFORM eq "amd") {
## Allow __fp16 as function parameter and return type.
$HIPCXXFLAGS .= " -Xclang -fallow-half-arguments-and-returns -D__HIP_HCC_COMPAT_MODE__=1";
}
+
+ # Gentoo: there is no FHS compliant location for .hipVersion where clang will still be
+ # able to find it, so .hipVersion has been omitted and the hip version is passed explicitly
+ $HIPCXXFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
+ $HIPCFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
+ $HIPLDFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
} elsif ($HIP_PLATFORM eq "nvidia") {
$CUDA_PATH=$ENV{'CUDA_PATH'} // '/usr/local/cuda';
$HIP_INCLUDE_PATH = "$HIP_PATH/include";

View file

@ -1,50 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake llvm
LLVM_MAX_SLOT=17
DESCRIPTION="Radeon Open Compute hipcc"
HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipcc"
KEYWORDS="~amd64"
SRC_URI="https://github.com/ROCm-Developer-Tools/hipcc/archive/refs/tags/rocm-${PV}.tar.gz -> hipcc-${PV}.tar.gz"
LICENSE="Apache-2.0 MIT"
SLOT="0/$(ver_cut 1-2)"
IUSE="debug test"
RESTRICT="!test? ( test )"
S=${WORKDIR}/HIPCC-rocm-${PV}
DEPEND="<llvm-core/llvm-18:=
<llvm-core/clang-18:=
"
RDEPEND="${DEPEND}
!<dev-util/hip-5.7"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-fno-stack-protector.patch"
"${FILESDIR}/${PN}-5.7.1-hipcc-hip-version.patch"
)
src_prepare() {
cmake_src_prepare
sed -e "s:\$ROCM_PATH/llvm/bin:$(get_llvm_prefix ${LLVM_MAX_SLOT})/bin:" \
-i bin/hipvars.pm || die
sed -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
-e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
-e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
-i bin/hipcc.pl || die
}
src_install() {
cmake_src_install
# rm unwanted copy
rm -rf "${ED}/usr/hip" || die
}

View file

@ -1,83 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( 20 )
inherit cmake perl-functions llvm-r1
DESCRIPTION="Radeon Open Compute hipcc"
HOMEPAGE="https://github.com/ROCm/hipcc"
MY_P=llvm-project-rocm-${PV}
components=( "amd/hipcc" )
if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/ROCm/llvm-project"
inherit git-r3
S="${WORKDIR}/${P}/${components[0]}"
else
SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}/${components[0]}"
KEYWORDS="~amd64"
fi
LICENSE="Apache-2.0 MIT"
SLOT="0/$(ver_cut 1-2)"
IUSE="debug test"
RESTRICT="!test? ( test )"
DEPEND="
$(llvm_gen_dep '
llvm-runtimes/compiler-rt:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
llvm-core/clang:${LLVM_SLOT}=
')
"
RDEPEND="${DEPEND}
!<dev-util/hip-5.7"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-hipcc-hip-version.patch"
)
src_unpack() {
if [[ ${PV} == *9999 ]] ; then
git-r3_fetch
git-r3_checkout '' . '' "${components[@]}"
else
archive="${MY_P}.tar.gz"
ebegin "Unpacking from ${archive}"
tar -x -z -o \
-f "${DISTDIR}/${archive}" \
"${components[@]/#/${MY_P}/}" || die
eend ${?}
fi
}
src_prepare() {
cmake_src_prepare
sed -e "s:\$ROCM_PATH/llvm/bin:$(get_llvm_prefix)/bin:" \
-e "s:/opt/rocm:/usr:" \
-i bin/hipvars.pm || die
sed -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
-e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
-e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
-i bin/hipcc.pl || die
# With Clang>17 -amdgpu-early-inline-all=true causes OOMs in dependencies
# https://github.com/llvm/llvm-project/issues/86332
if [ "$LLVM_SLOT" != "17" ]; then
sed -e "s/-mllvm -amdgpu-early-inline-all=true //g" -i bin/hipcc.pl || die
fi
}
src_install() {
cmake_src_install
# rm unwanted copy
rm -rf "${ED}/usr/hip" || die
# Handle hipvars.pm
rm "${ED}/usr/bin/hipvars.pm" || die
perl_domodule "${S}"/bin/hipvars.pm
}

View file

@ -1,83 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( 20 )
inherit cmake perl-functions llvm-r1
DESCRIPTION="Radeon Open Compute hipcc"
HOMEPAGE="https://github.com/ROCm/hipcc"
MY_P=llvm-project-rocm-${PV}
components=( "amd/hipcc" )
if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/ROCm/llvm-project"
inherit git-r3
S="${WORKDIR}/${P}/${components[0]}"
else
SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}/${components[0]}"
KEYWORDS="~amd64"
fi
LICENSE="Apache-2.0 MIT"
SLOT="0/$(ver_cut 1-2)"
IUSE="debug test"
RESTRICT="!test? ( test )"
DEPEND="
$(llvm_gen_dep '
llvm-runtimes/compiler-rt:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
llvm-core/clang:${LLVM_SLOT}=
')
"
RDEPEND="${DEPEND}
!<dev-util/hip-5.7"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-hipcc-hip-version.patch"
)
src_unpack() {
if [[ ${PV} == *9999 ]] ; then
git-r3_fetch
git-r3_checkout '' . '' "${components[@]}"
else
archive="${MY_P}.tar.gz"
ebegin "Unpacking from ${archive}"
tar -x -z -o \
-f "${DISTDIR}/${archive}" \
"${components[@]/#/${MY_P}/}" || die
eend ${?}
fi
}
src_prepare() {
cmake_src_prepare
sed -e "s:\$ROCM_PATH/llvm/bin:$(get_llvm_prefix)/bin:" \
-e "s:/opt/rocm:/usr:" \
-i bin/hipvars.pm || die
sed -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
-e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
-e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
-i bin/hipcc.pl || die
# With Clang>17 -amdgpu-early-inline-all=true causes OOMs in dependencies
# https://github.com/llvm/llvm-project/issues/86332
if [ "$LLVM_SLOT" != "17" ]; then
sed -e "s/-mllvm -amdgpu-early-inline-all=true //g" -i bin/hipcc.pl || die
fi
}
src_install() {
cmake_src_install
# rm unwanted copy
rm -rf "${ED}/usr/hip" || die
# Handle hipvars.pm
rm "${ED}/usr/bin/hipvars.pm" || die
perl_domodule "${S}"/bin/hipvars.pm
}

View file

@ -1,85 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( 20 )
inherit cmake perl-functions llvm-r1
DESCRIPTION="Radeon Open Compute hipcc"
HOMEPAGE="https://github.com/ROCm/llvm-project/tree/amd-staging/amd/hipcc"
MY_P=llvm-project-rocm-${PV}
components=( "amd/hipcc" )
if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/ROCm/llvm-project"
inherit git-r3
S="${WORKDIR}/${P}/${components[0]}"
else
SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}/${components[0]}"
KEYWORDS="~amd64"
fi
LICENSE="Apache-2.0 MIT"
SLOT="0/$(ver_cut 1-2)"
IUSE="debug test"
RESTRICT="!test? ( test )"
DEPEND="
$(llvm_gen_dep '
llvm-runtimes/compiler-rt:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
llvm-core/clang:${LLVM_SLOT}=
')
"
RDEPEND="${DEPEND}
!<dev-util/hip-5.7
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-hipcc-hip-version.patch"
)
src_unpack() {
if [[ ${PV} == *9999 ]] ; then
git-r3_fetch
git-r3_checkout '' . '' "${components[@]}"
else
archive="${MY_P}.tar.gz"
ebegin "Unpacking from ${archive}"
tar -x -z -o \
-f "${DISTDIR}/${archive}" \
"${components[@]/#/${MY_P}/}" || die
eend ${?}
fi
}
src_prepare() {
cmake_src_prepare
sed -e "s:lib/llvm/bin:lib/llvm/${LLVM_SLOT}/bin:" \
-e "s:/opt/rocm:/usr:g" \
-i bin/hipvars.pm \
-i src/hipBin_base.h \
-i src/hipBin_amd.h || die
sed -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
-e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
-i bin/hipcc.pl || die
# With Clang>17 -amdgpu-early-inline-all=true causes OOMs in dependencies
# https://github.com/llvm/llvm-project/issues/86332
sed -e "s/-mllvm -amdgpu-early-inline-all=true //g" \
-i bin/hipcc.pl \
-i src/hipBin_amd.h || die
}
src_install() {
cmake_src_install
# rm unwanted copy
rm -rf "${ED}/usr/hip" || die
# Handle hipvars.pm
rm "${ED}/usr/bin/hipvars.pm" || die
perl_domodule "${S}"/bin/hipvars.pm
}

View file

@ -1,85 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( 20 )
inherit cmake perl-functions llvm-r1
DESCRIPTION="Radeon Open Compute hipcc"
HOMEPAGE="https://github.com/ROCm/llvm-project/tree/amd-staging/amd/hipcc"
MY_P=llvm-project-rocm-${PV}
components=( "amd/hipcc" )
if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/ROCm/llvm-project"
inherit git-r3
S="${WORKDIR}/${P}/${components[0]}"
else
SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}/${components[0]}"
KEYWORDS="~amd64"
fi
LICENSE="Apache-2.0 MIT"
SLOT="0/$(ver_cut 1-2)"
IUSE="debug test"
RESTRICT="!test? ( test )"
DEPEND="
$(llvm_gen_dep '
llvm-runtimes/compiler-rt:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
llvm-core/clang:${LLVM_SLOT}=
')
"
RDEPEND="${DEPEND}
!<dev-util/hip-5.7
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-hipcc-hip-version.patch"
)
src_unpack() {
if [[ ${PV} == *9999 ]] ; then
git-r3_fetch
git-r3_checkout '' . '' "${components[@]}"
else
archive="${MY_P}.tar.gz"
ebegin "Unpacking from ${archive}"
tar -x -z -o \
-f "${DISTDIR}/${archive}" \
"${components[@]/#/${MY_P}/}" || die
eend ${?}
fi
}
src_prepare() {
cmake_src_prepare
sed -e "s:lib/llvm/bin:lib/llvm/${LLVM_SLOT}/bin:" \
-e "s:/opt/rocm:/usr:g" \
-i bin/hipvars.pm \
-i src/hipBin_base.h \
-i src/hipBin_amd.h || die
sed -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
-e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
-i bin/hipcc.pl || die
# With Clang>17 -amdgpu-early-inline-all=true causes OOMs in dependencies
# https://github.com/llvm/llvm-project/issues/86332
sed -e "s/-mllvm -amdgpu-early-inline-all=true //g" \
-i bin/hipcc.pl \
-i src/hipBin_amd.h || die
}
src_install() {
cmake_src_install
# rm unwanted copy
rm -rf "${ED}/usr/hip" || die
# Handle hipvars.pm
rm "${ED}/usr/bin/hipvars.pm" || die
perl_domodule "${S}"/bin/hipvars.pm
}

View file

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>sci@gentoo.org</email>
<name>Gentoo Science Project</name>
</maintainer>
<maintainer type="person">
<email>candrews@gentoo.org</email>
<name>Craig Andrews</name>
</maintainer>
<maintainer type="person">
<email>patrick@gentoo.org</email>
<name>Patrick Lauer</name>
</maintainer>
<maintainer type="person" proxied="yes">
<email>xgreenlandforwyy@gmail.com</email>
<name>Yiyang Wu</name>
</maintainer>
<maintainer type="person" proxied="yes">
<email>gentoo@holzke.net</email>
<name>Wilfried Holzke</name>
</maintainer>
<maintainer type="person">
<email>lockalsash@gmail.com</email>
<name>Sv. Lockal</name>
</maintainer>
<upstream>
<remote-id type="github">ROCm/hipcc</remote-id>
</upstream>
</pkgmetadata>

View file

@ -1,4 +0,0 @@
DIST HIPIFY-5.7.1.tar.gz 673452 BLAKE2B e0293c1b7f9ea028efc8d712ddedae4ec933c5bcfba524e13816bd999e67bcf06097f9fe0e4d1f4fa6a38df133be694e92adeefd92f77301d8537b6880b1a1fe SHA512 0cc75fdbcb6278d319cfe8ee3c8547dc75ea494a007d2159c64312c3411627905e0d6c7d7f0032cbc4c727a90723325aa2705db2fd473dbeb41e60f276d1c9a7
DIST HIPIFY-6.1.1.tar.gz 813425 BLAKE2B accc661431f11796d0c8bcf638537a6035020b2a36ebe66c1b8c10bb63b762418d5fd1f256f3a3e51d2ace224a6492abfe72838bef859b1da68c2126cc3521be SHA512 29c45e312c8e2f0d06916b57f24eba27ba7beae3bd860850b57cfe27c87df22aabe9fdcf3d12671b81e68b61c3974aaf0064e96ae68392d181148aaeef14f1c7
DIST HIPIFY-6.3.2.tar.gz 978994 BLAKE2B 7f35d462f69ab298485ef27b53624676071be551d671532383f246dbe6cd133ce1b30fb98d5457b82a0a9a01070cc6050e14f4f8fdecbf04a9b589309c3afd67 SHA512 26fc5db270e661d3ca380dfd570f2b46108c41b808f84413b27c4b6efaf6796ae625d4489c2278c253345d8a25408f636fde476be380b08d489254e20b8a12c0
DIST HIPIFY-6.3.3.tar.gz 978886 BLAKE2B 391afa3ca27651597264ada3f1ef8f2a3ed75d7f0bbd29b868e89d0ecd6a76986fb4b74e15d62c7a0990d5e8a6c5e92cf4e987ddbf3fb5e45eddd2f9d22c9b45 SHA512 5fe529db7ef9de56e127ced21c62b45b770aa383913bd9d373e7c4eb16e1028a6414ae25aa2f40c79b45f5a2dcb4318cd6773cf821c814bfd545431512cae490

View file

@ -1,47 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce188b7..19bd013 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,41 +68,7 @@ if (NOT HIPIFY_CLANG_TESTS_ONLY)
endif()
# Link against LLVM and CLANG libraries.
- target_link_libraries(hipify-clang PRIVATE
- clangASTMatchers
- clangFrontend
- clangTooling
- clangParse
- clangSerialization
- clangSema
- clangEdit
- clangFormat
- clangLex
- clangAnalysis
- clangDriver
- clangAST
- clangToolingCore
- clangRewrite
- clangBasic
- LLVMProfileData
- LLVMSupport
- LLVMMCParser
- LLVMMC
- LLVMBitReader
- LLVMOption
- LLVMCore)
-
- if(LLVM_PACKAGE_VERSION VERSION_GREATER "6.0.1")
- target_link_libraries(hipify-clang PRIVATE clangToolingInclusions)
- endif()
-
- if(LLVM_PACKAGE_VERSION VERSION_GREATER "9.0.1")
- target_link_libraries(hipify-clang PRIVATE LLVMFrontendOpenMP)
- endif()
-
- if(LLVM_PACKAGE_VERSION VERSION_EQUAL "15.0.0" OR LLVM_PACKAGE_VERSION VERSION_GREATER "15.0.0")
- target_link_libraries(hipify-clang PRIVATE LLVMWindowsDriver clangSupport)
- endif()
+ target_link_libraries(hipify-clang PRIVATE clang clang-cpp)
if(LLVM_PACKAGE_VERSION VERSION_EQUAL "16.0.0" OR LLVM_PACKAGE_VERSION VERSION_GREATER "16.0.0")
if(MSVC)

View file

@ -1,41 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="A set of tools to translate CUDA source code into portable HIP C++"
HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIPIFY"
SRC_URI="https://github.com/ROCm-Developer-Tools/HIPIFY/archive/rocm-${PV}.tar.gz -> HIPIFY-${PV}.tar.gz"
LICENSE="MIT"
KEYWORDS="~amd64"
SLOT="0/$(ver_cut 1-2)"
BDEPEND=">=dev-build/cmake-3.22"
DEPEND="
llvm-core/clang:17
llvm-core/llvm:17"
S="${WORKDIR}/HIPIFY-rocm-${PV}"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-fix-clang-libs.patch"
)
src_prepare() {
cmake_src_prepare
sed -i 's:/../libexec/hipify::' \
bin/hipconvertinplace.sh bin/hipconvertinplace-perl.sh \
bin/hipexamine-perl.sh bin/hipexamine.sh || die
# Workaround for bug https://github.com/ROCm/HIPIFY/issues/1396
sed -i 's/find_package(LLVM REQUIRED/find_package(LLVM 17 REQUIRED/' CMakeLists.txt || die
}
src_install() {
cmake_src_install
# rm unwanted copy
rm -rf "${ED}/usr/hip" || die
}

View file

@ -1,55 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( 20 )
inherit cmake flag-o-matic llvm-r1
DESCRIPTION="A set of tools to translate CUDA source code into portable HIP C++"
HOMEPAGE="https://github.com/ROCm/HIPIFY"
SRC_URI="https://github.com/ROCm/HIPIFY/archive/rocm-${PV}.tar.gz -> HIPIFY-${PV}.tar.gz"
S="${WORKDIR}/HIPIFY-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
BDEPEND=">=dev-build/cmake-3.22"
DEPEND="
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-fix-clang-libs.patch"
)
src_prepare() {
cmake_src_prepare
sed -i 's:/../libexec/hipify::' \
bin/hipconvertinplace.sh bin/hipconvertinplace-perl.sh \
bin/hipexamine-perl.sh bin/hipexamine.sh || die
}
src_configure() {
# 928906: CMakeLists.txt ignores CC/CXX, switches compiler to clang
# and fails if non-compatible CFLAGS/CXXFLAGS are used
strip-unsupported-flags
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix)/$(get_libdir)/cmake/llvm"
)
cmake_src_configure
}
src_install() {
cmake_src_install
# rm unwanted copy
rm -rf "${ED}/usr/hip" || die
}

View file

@ -1,58 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( 20 )
inherit cmake flag-o-matic llvm-r1
DESCRIPTION="A set of tools to translate CUDA source code into portable HIP C++"
HOMEPAGE="https://github.com/ROCm/HIPIFY"
SRC_URI="https://github.com/ROCm/HIPIFY/archive/rocm-${PV}.tar.gz -> HIPIFY-${PV}.tar.gz"
S="${WORKDIR}/HIPIFY-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
BDEPEND=">=dev-build/cmake-3.22"
DEPEND="
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-fix-clang-libs.patch"
)
src_prepare() {
cmake_src_prepare
sed -i 's:/../libexec/hipify::' \
bin/hipconvertinplace.sh bin/hipconvertinplace-perl.sh \
bin/hipexamine-perl.sh bin/hipexamine.sh || die
}
src_configure() {
# 928906: CMakeLists.txt ignores CC/CXX, switches compiler to clang
# and fails if non-compatible CFLAGS/CXXFLAGS are used
strip-unsupported-flags
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix)/$(get_libdir)/cmake/llvm"
)
cmake_src_configure
}
src_install() {
cmake_src_install
fperms +x /usr/bin/hipconvertinplace-perl.sh
fperms +x /usr/bin/hipconvertinplace.sh
fperms +x /usr/bin/hipexamine-perl.sh
fperms +x /usr/bin/hipexamine.sh
fperms +x /usr/bin/hipify-perl
}

View file

@ -1,58 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( 20 )
inherit cmake flag-o-matic llvm-r1
DESCRIPTION="A set of tools to translate CUDA source code into portable HIP C++"
HOMEPAGE="https://github.com/ROCm/HIPIFY"
SRC_URI="https://github.com/ROCm/HIPIFY/archive/rocm-${PV}.tar.gz -> HIPIFY-${PV}.tar.gz"
S="${WORKDIR}/HIPIFY-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
BDEPEND=">=dev-build/cmake-3.22"
DEPEND="
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-fix-clang-libs.patch"
)
src_prepare() {
cmake_src_prepare
sed -i 's:/../libexec/hipify::' \
bin/hipconvertinplace.sh bin/hipconvertinplace-perl.sh \
bin/hipexamine-perl.sh bin/hipexamine.sh || die
}
src_configure() {
# 928906: CMakeLists.txt ignores CC/CXX, switches compiler to clang
# and fails if non-compatible CFLAGS/CXXFLAGS are used
strip-unsupported-flags
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix)/$(get_libdir)/cmake/llvm"
)
cmake_src_configure
}
src_install() {
cmake_src_install
fperms +x /usr/bin/hipconvertinplace-perl.sh
fperms +x /usr/bin/hipconvertinplace.sh
fperms +x /usr/bin/hipexamine-perl.sh
fperms +x /usr/bin/hipexamine.sh
fperms +x /usr/bin/hipify-perl
}

View file

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>sci@gentoo.org</email>
<name>Gentoo Science Project</name>
</maintainer>
<maintainer type="person">
<email>lockalsash@gmail.com</email>
<name>Sv. Lockal</name>
</maintainer>
<upstream>
<remote-id type="github">ROCm/HIPIFY</remote-id>
</upstream>
</pkgmetadata>

View file

@ -1,2 +0,0 @@
DIST intel-graphics-compiler-1.0.17791.18.tar.gz 10746999 BLAKE2B d85c7888e4be962fc90ba6e2686aeba14d7ebe32c7dececdfddb0ba3726df82e43167dfc1bd0a2c4a0f72a6de481a270a4dcb6b4d5a40d785dac6c4628a27e2d SHA512 c814f667c558eebfbe1af68614c4eff7259b2d3626e317eb936e185b33b4aba7b225f33276ab09e9582164e5573b6cc52c230ab82e4689db41b3b2f4368367ec
DIST intel-graphics-compiler-2.7.8.tar.gz 11044562 BLAKE2B ab1b3fc35cfc668a3e7e9c6a8eb772d0f8a6c04b842ad543044d3d210e832482cc9e8092cc0ceaabd4245f7795530c16fb607cc304c0b4cf8abfabfb2f67f911 SHA512 ab663ce9c715e14cb61f7a442ed5c7e68167f18c3116d2c78cb08d8ae1f7f6a47e16ac8c5fd191c51ef03692117c31881fbae84bd5a353fe95698bcb278fd26f

View file

@ -1,31 +0,0 @@
--- a/IGC/BiFModule/CMakeLists.txt
+++ b/IGC/BiFModule/CMakeLists.txt
@@ -19,24 +19,10 @@
if(UNIX)
if(NOT ${CCLANG_BUILD_INTREE_LLVM})
- # Get common clang library soname
- get_target_property(CCLANG_LIB_PATH opencl-clang-lib "IMPORTED_LOCATION")
- execute_process(
- COMMAND readelf -d ${CCLANG_LIB_PATH}
- RESULT_VARIABLE CCLANG_READELF_RESULT
- OUTPUT_VARIABLE CCLANG_READELF_CALL)
- if(CCLANG_READELF_RESULT AND NOT CCLANG_READELF_RESULT EQUAL 0)
- message(FATAL_ERROR "[IGC\\BiFModule] : Error occurred while executing readelf: ${CCLANG_READELF_RESULT}")
- endif()
- string(REGEX MATCH "\\[${COMMON_CLANG_LIB_FULL_NAME}\\.([0-9](\\.[0-9]*)*[a-zA-Z0-9]*)\\]" CCLANG_SONAME_VERSION "${CCLANG_READELF_CALL}")
- set(CCLANG_SONAME_VERSION "${CMAKE_MATCH_1}")
-
- # Check if common clang library is newer than 5.0.0 version on which we have SPIR-V support
- if("${CCLANG_SONAME_VERSION}" VERSION_GREATER "5.0.0")
- set_property(TARGET opencl-clang-lib PROPERTY "IMPORTED_SONAME" "${COMMON_CLANG_LIB_FULL_NAME}.${CCLANG_SONAME_VERSION}")
- else()
- message(FATAL_ERROR "[IGC\\BiFModule] : Version ${CCLANG_SONAME_VERSION} of library ${COMMON_CLANG_LIB_FULL_NAME} is below version 5.0.0 (where it's starts support of SPIR-V), please upgrade this library at least to version 5.0.0")
- endif()
+ # Workaround for https://bugs.gentoo.org/739138 : instead of checking
+ # the version of opencl-clang, have ebuilds set CCLANG_SONAME_VERSION
+ # for us.
+ set_property(TARGET opencl-clang-lib PROPERTY "IMPORTED_SONAME" "${COMMON_CLANG_LIB_FULL_NAME}.${CCLANG_SONAME_VERSION}")
endif()
if (NOT CCLANG_FROM_SYSTEM)
install(FILES $<TARGET_FILE:opencl-clang-lib> DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT igc-opencl)

View file

@ -1,37 +0,0 @@
From d0f801a178755504c2f8956841823b2aa6a124c4 Mon Sep 17 00:00:00 2001
From: Conrad Kostecki <conikost@gentoo.org>
Date: Sat, 28 Aug 2021 00:57:59 +0200
Subject: [PATCH] IGC: CMakeLists: drop git
Dropping git, as we don't have any git release.
Signed-off-by: Conrad Kostecki <conrad@kostecki.com>
---
visa/iga/IGALibrary/CMakeLists.txt | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/visa/iga/IGALibrary/CMakeLists.txt b/visa/iga/IGALibrary/CMakeLists.txt
index 061476d94..2fd44807c 100644
--- a/visa/iga/IGALibrary/CMakeLists.txt
+++ b/visa/iga/IGALibrary/CMakeLists.txt
@@ -14,17 +14,6 @@ set(CMAKE_CXX_STANDARD 14)
##############################################
# compute the version string from the git repo
-execute_process(
- COMMAND git rev-parse --short HEAD
- OUTPUT_VARIABLE GIT_COMMIT
- OUTPUT_STRIP_TRAILING_WHITESPACE
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-#
-execute_process(
- COMMAND git diff-index --quiet HEAD --
- RESULT_VARIABLE GIT_DIRTY
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-
set(IGA_VERSION_SUFFIX "")
if(GIT_COMMIT)
set(IGA_VERSION_DIRTY_TAG "")
--
2.33.0

View file

@ -1,10 +0,0 @@
--- a/IGC/CMakeLists.txt
+++ b/IGC/CMakeLists.txt
@@ -2769,7 +2769,6 @@
-march=corei7
-mstackrealign
-fms-extensions
- -Werror
-Wno-unused-parameter
-Wno-missing-field-initializers
-Wwrite-strings

View file

@ -1,109 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CMAKE_BUILD_TYPE="Release"
LLVM_COMPAT=( 20 )
MY_PN="igc"
MY_P="${MY_PN}-${PV}"
PYTHON_COMPAT=( python3_{10..13} )
inherit cmake flag-o-matic llvm-r1 python-any-r1
DESCRIPTION="LLVM-based OpenCL compiler for OpenCL targetting Intel Gen graphics hardware"
HOMEPAGE="https://github.com/intel/intel-graphics-compiler"
SRC_URI="https://github.com/intel/${PN}/archive/refs/tags/${MY_P}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${MY_P}"
LICENSE="MIT"
SLOT="0/1.0.1"
KEYWORDS="amd64"
IUSE="debug vc"
DEPEND="
dev-libs/opencl-clang:15[${LLVM_USEDEP}]
dev-util/spirv-tools
$(llvm_gen_dep '
llvm-core/lld:${LLVM_SLOT}
llvm-core/llvm:${LLVM_SLOT}
')
vc? (
>=dev-libs/intel-vc-intrinsics-0.21.0[${LLVM_USEDEP}]
dev-util/spirv-llvm-translator:15=
)
"
RDEPEND="${DEPEND}"
BDEPEND="
$(python_gen_any_dep 'dev-python/mako[${PYTHON_USEDEP}]')
$(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
$(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
${PYTHON_DEPS}
"
python_check_deps() {
python_has_version "dev-python/mako[${PYTHON_USEDEP}]"
python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
}
PATCHES=(
"${FILESDIR}/${PN}-1.0.9-no_Werror.patch"
"${FILESDIR}/${PN}-1.0.8173-opencl-clang_version.patch"
"${FILESDIR}/${PN}-1.0.8365-disable-git.patch"
)
pkg_setup() {
llvm-r1_pkg_setup
python-any-r1_pkg_setup
}
src_prepare() {
# Don't hardcode FORTIFY_SOURCE
sed -e '/-D_FORTIFY_SOURCE=2/d' -i IGC/CMakeLists.txt || die
cmake_src_prepare
}
src_configure() {
# Get LLVM version
local llvm_version="$(best_version -d llvm-core/llvm:${LLVM_SLOT})"
local llvm_version="${llvm_version%%-r*}"
# See https://github.com/intel/intel-graphics-compiler/issues/212
append-ldflags -Wl,-z,undefs
# See bug #893370 and https://github.com/intel/intel-graphics-compiler/issues/282
append-flags -U_GLIBCXX_ASSERTIONS
# See https://bugs.gentoo.org/718824
! use debug && append-cppflags -DNDEBUG
local mycmakeargs=(
-DBUILD_SHARED_LIBS="OFF"
-DCCLANG_FROM_SYSTEM="ON"
-DCCLANG_SONAME_VERSION="${LLVM_SLOT}"
-DCMAKE_LIBRARY_PATH="$(get_llvm_prefix)/$(get_libdir)"
-DIGC_BUILD__VC_ENABLED="$(usex vc)"
-DIGC_OPTION__ARCHITECTURE_TARGET="Linux64"
-DIGC_OPTION__CLANG_MODE="Prebuilds"
-DIGC_OPTION__LINK_KHRONOS_SPIRV_TRANSLATOR="ON"
-DIGC_OPTION__LLD_MODE="Prebuilds"
-DIGC_OPTION__LLDELF_H_DIR="$(get_llvm_prefix)/include/lld/Common"
-DIGC_OPTION__LLVM_MODE="Prebuilds"
-DIGC_OPTION__LLVM_PREFERRED_VERSION="${llvm_version##*-}"
-DIGC_OPTION__OPENCL_HEADER_PATH="/usr/lib/clang/${llvm_version##*-}/include/opencl-c.h"
-DIGC_OPTION__SPIRV_TOOLS_MODE="Prebuilds"
-DIGC_OPTION__SPIRV_TRANSLATOR_MODE="Prebuilds"
-DIGC_OPTION__USE_KHRONOS_SPIRV_TRANSLATOR_IN_SC="ON"
-DIGC_OPTION__USE_PREINSTALLED_SPIRV_HEADERS="ON"
$(usex vc '-DIGC_OPTION__VC_INTRINSICS_MODE=Prebuilds' '')
-DPYTHON_EXECUTABLE="${PYTHON}"
-DINSTALL_GENX_IR="ON"
-DSPIRVLLVMTranslator_INCLUDE_DIR="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/include/LLVMSPIRVLib"
-Wno-dev
)
cmake_src_configure
}

View file

@ -1,104 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CMAKE_BUILD_TYPE="Release"
LLVM_COMPAT=( 20 )
PYTHON_COMPAT=( python3_{10..13} )
inherit cmake flag-o-matic llvm-r1 python-any-r1
DESCRIPTION="LLVM-based OpenCL compiler for OpenCL targetting Intel Gen graphics hardware"
HOMEPAGE="https://github.com/intel/intel-graphics-compiler"
SRC_URI="https://github.com/intel/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0/2.5.0"
KEYWORDS="~amd64"
IUSE="debug vc"
DEPEND="
dev-libs/opencl-clang:15[${LLVM_USEDEP}]
dev-util/spirv-tools
$(llvm_gen_dep '
llvm-core/lld:${LLVM_SLOT}
llvm-core/llvm:${LLVM_SLOT}
')
vc? (
>=dev-libs/intel-vc-intrinsics-0.22.0[${LLVM_USEDEP}]
dev-util/spirv-llvm-translator:15=
)
"
RDEPEND="${DEPEND}"
BDEPEND="
$(python_gen_any_dep 'dev-python/mako[${PYTHON_USEDEP}]')
$(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
$(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
${PYTHON_DEPS}
"
python_check_deps() {
python_has_version "dev-python/mako[${PYTHON_USEDEP}]"
python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
}
PATCHES=(
"${FILESDIR}/${PN}-1.0.9-no_Werror.patch"
"${FILESDIR}/${PN}-1.0.8365-disable-git.patch"
)
pkg_setup() {
llvm-r1_pkg_setup
python-any-r1_pkg_setup
}
src_prepare() {
# Don't hardcode FORTIFY_SOURCE
sed -e '/-D_FORTIFY_SOURCE=2/d' -i IGC/CMakeLists.txt || die
cmake_src_prepare
}
src_configure() {
# Get LLVM version
local llvm_version="$(best_version -d llvm-core/llvm:${LLVM_SLOT})"
local llvm_version="${llvm_version%%-r*}"
# See https://github.com/intel/intel-graphics-compiler/issues/212
append-ldflags -Wl,-z,undefs
# See bug #893370 and https://github.com/intel/intel-graphics-compiler/issues/282
append-flags -U_GLIBCXX_ASSERTIONS
# See https://bugs.gentoo.org/718824
! use debug && append-cppflags -DNDEBUG
local mycmakeargs=(
-DBUILD_SHARED_LIBS="OFF"
-DCCLANG_FROM_SYSTEM="ON"
-DCCLANG_SONAME_VERSION="${LLVM_SLOT}"
-DCMAKE_LIBRARY_PATH="$(get_llvm_prefix)/$(get_libdir)"
-DIGC_BUILD__VC_ENABLED="$(usex vc)"
-DIGC_OPTION__ARCHITECTURE_TARGET="Linux64"
-DIGC_OPTION__CLANG_MODE="Prebuilds"
-DIGC_OPTION__LINK_KHRONOS_SPIRV_TRANSLATOR="ON"
-DIGC_OPTION__LLD_MODE="Prebuilds"
-DIGC_OPTION__LLDELF_H_DIR="$(get_llvm_prefix)/include/lld/Common"
-DIGC_OPTION__LLVM_MODE="Prebuilds"
-DIGC_OPTION__LLVM_PREFERRED_VERSION="${llvm_version##*-}"
-DIGC_OPTION__OPENCL_HEADER_PATH="/usr/lib/clang/${llvm_version##*-}/include/opencl-c.h"
-DIGC_OPTION__SPIRV_TOOLS_MODE="Prebuilds"
-DIGC_OPTION__SPIRV_TRANSLATOR_MODE="Prebuilds"
-DIGC_OPTION__USE_KHRONOS_SPIRV_TRANSLATOR_IN_SC="ON"
-DIGC_OPTION__USE_PREINSTALLED_SPIRV_HEADERS="ON"
$(usex vc '-DIGC_OPTION__VC_INTRINSICS_MODE=Prebuilds' '')
-DPYTHON_EXECUTABLE="${PYTHON}"
-DSPIRVLLVMTranslator_INCLUDE_DIR="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/include/LLVMSPIRVLib"
-Wno-dev
)
cmake_src_configure
}

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person" proxied="yes">
<email>gentoo@taujhe.de</email>
<name>Jan Henke</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<maintainer type="person">
<email>conikost@gentoo.org</email>
<name>Conrad Kostecki</name>
</maintainer>
<use>
<flag name="vc">Enable VectorCompiler for a better performance.</flag>
</use>
<upstream>
<remote-id type="github">intel/intel-graphics-compiler</remote-id>
</upstream>
</pkgmetadata>

View file

@ -1,4 +0,0 @@
DIST roctracer-5.7.1.tar.gz 354686 BLAKE2B 2e72d8df5cf53a913102a715dab55f7c6d33b2d4a9cad7647a61824deba0363cf3dbf96d8de3469a78d6b5c8e517c163c303bf6aa12eeaf8e43f82ac8381ef97 SHA512 62cf62fc505955426596bd6d539c92f4d730d90d820d817343525f1b7be693290727c8c447ca98b1a0e46d1d188b62b3f4fafcf6bffbf2479fc5d937fb354e13
DIST roctracer-6.1.1.tar.gz 396688 BLAKE2B e332c3a6056d1678e3da511878fd2710a4eaa02526cd1e7353dd1dbcba776cb77e6e431d90daf5f238ec7793fc8e9f51afd7f09992f70b26c7e3aab28bb319a9 SHA512 d59c367953b1d5df0daae96746095e2e19f706f43b5ebed3d45c15d23697e9c99c1623bbb8dfa001648fdeda172a3c1d820d884b6da3946addec8f4b9a86e5dc
DIST roctracer-6.3.2.tar.gz 397366 BLAKE2B 0edc2e6483935dcbc8e905b1eac1d426c3e553491cbe119a8f6cba99cadad5c622ec7a0005e27e66d57f9baf4e3048033185cd38f32b4cfd17277d80673ac225 SHA512 d08657e8424cf2fbdee1caa46140dd90f45b5efe7c71a96c789b0bb350d7c36a9c725ae436bee00fb0948ab0de5fc5356f71082619edae1316922221c19eae1c
DIST roctracer-6.3.3.tar.gz 397370 BLAKE2B dff4c796b7284c2107ef0d308ee16d640aab6e9ce49c769a84352837f3e29e24e09e71d5a1d1fe19d22d218e607e85f7fbe6b43ff1a0a1f6e04aa859baefd054 SHA512 50ee107b7c8676dd5d41d2b9433fce701807b954b3d6624c25c32d057bd3a50ad2c7f853cb287c7bb5dd1f5fe2c3b0ec4a7cb082d5ef545c17f2ae2644c1df7c

View file

@ -1,12 +0,0 @@
Append flags for clang to recognize device lib path
===================================================================
--- roctracer-rocm-5.3.3.orig/test/CMakeLists.txt
+++ roctracer-rocm-5.3.3/test/CMakeLists.txt
@@ -80,6 +80,7 @@ add_dependencies(mytest codeobj_test)
function(generate_hsaco TARGET_ID INPUT_FILE OUTPUT_FILE)
separate_arguments(CLANG_ARG_LIST UNIX_COMMAND
"-O2 -x cl -Xclang -finclude-default-header -cl-denorms-are-zero -cl-std=CL2.0 -Wl,--build-id=sha1
+ --rocm-path=@GENTOO_PORTAGE_EPREFIX@/usr --rocm-device-lib-path=@GENTOO_PORTAGE_EPREFIX@/usr/lib/amdgcn/bitcode
-target amdgcn-amd-amdhsa -mcpu=${TARGET_ID} -o ${OUTPUT_FILE} ${INPUT_FILE}")
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${OUTPUT_FILE}
COMMAND clang ${CLANG_ARG_LIST}

View file

@ -1,11 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,7 +56,7 @@ endif()
add_subdirectory(src)
## Build tests
-if(${LIBRARY_TYPE} STREQUAL SHARED)
+if(WITH_TESTS)
add_subdirectory(test)
endif()

View file

@ -1,67 +0,0 @@
--- a/script/gen_ostream_ops.py
+++ b/script/gen_ostream_ops.py
@@ -242,7 +242,15 @@ def gen_cppheader(infilepath, outfilepath, rank):
if c == 'max_align_t' or c == '__fsid_t': # Skipping as it is defined in multiple domains
continue
if len(cppHeader.classes[c]["properties"]["public"]) != 0:
- output_filename_h.write("inline static std::ostream& operator<<(std::ostream& out, const " + c + "& v)\n")
+ print_c = ("typename " + c) if '>::' in c else c
+
+ if '<T' in c:
+ output_filename_h.write("template <typename T>\n")
+ elif c == 'HIP_vector_type':
+ output_filename_h.write("template<typename T, unsigned int rank>\n")
+ print_c = 'HIP_vector_type<T, rank>'
+
+ output_filename_h.write("inline static std::ostream& operator<<(std::ostream& out, const " + print_c + "& v)\n")
output_filename_h.write("{\n")
output_filename_h.write(" std::operator<<(out, '{');\n")
output_filename_h.write(" " + apiname.upper() + "_depth_max_cnt++;\n")
@@ -257,7 +265,13 @@ def gen_cppheader(infilepath, outfilepath, rank):
output_filename_h.write(" return out;\n")
output_filename_h.write("}\n")
global_str = ''
- global_ops += "inline static std::ostream& operator<<(std::ostream& out, const " + c + "& v)\n" + "{\n" + " roctracer::" + apiname.lower() + "_support::detail::operator<<(out, v);\n" + " return out;\n" + "}\n\n"
+
+ if '<T' in c:
+ global_ops += "template <typename T>\n"
+ elif c == 'HIP_vector_type':
+ global_ops += "template<typename T, unsigned int rank>\n"
+
+ global_ops += "inline static std::ostream& operator<<(std::ostream& out, const " + print_c + "& v)\n" + "{\n" + " roctracer::" + apiname.lower() + "_support::detail::operator<<(out, v);\n" + " return out;\n" + "}\n\n"
if rank == 1 or rank == 2:
footer = '// end ostream ops for '+ apiname + ' \n'
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -61,11 +61,19 @@ add_custom_command(
"${HSA_RUNTIME_INC_PATH}/hsa_ext_image.h" "${HSA_RUNTIME_INC_PATH}/hsa_api_trace.h"
COMMENT "Generating hsa_prof_str.h,hsa_prof_str.inline.h...")
+set(SYSTEM_HEADERS_DIR ${CMAKE_CURRENT_BINARY_DIR}/system-headers)
+
+execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${SYSTEM_HEADERS_DIR}")
+execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${SYSTEM_HEADERS_DIR}/array")
+execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${SYSTEM_HEADERS_DIR}/iosfwd")
+execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${SYSTEM_HEADERS_DIR}/type_traits")
+
+
## Generate the HSA pretty printers
add_custom_command(
OUTPUT hsa_ostream_ops.h
- COMMAND ${CMAKE_C_COMPILER} -E "${HSA_RUNTIME_INC_PATH}/hsa.h" -o hsa.h.i
- COMMAND ${CMAKE_C_COMPILER} -E "${HSA_RUNTIME_INC_PATH}/hsa_ext_amd.h" -o hsa_ext_amd.h.i
+ COMMAND ${CMAKE_C_COMPILER} -nostdinc++ -isystem ${SYSTEM_HEADERS_DIR} -E "${HSA_RUNTIME_INC_PATH}/hsa.h" -o hsa.h.i
+ COMMAND ${CMAKE_C_COMPILER} -nostdinc++ -isystem ${SYSTEM_HEADERS_DIR} -E "${HSA_RUNTIME_INC_PATH}/hsa_ext_amd.h" -o hsa_ext_amd.h.i
BYPRODUCTS hsa.h.i hsa_ext_amd.h.i
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/script/gen_ostream_ops.py
-in hsa.h.i,hsa_ext_amd.h.i -out hsa_ostream_ops.h > /dev/null
@@ -83,7 +91,7 @@ find_file(HIP_RUNTIME_API_H hip_runtime_api.h
## Generate the HIP pretty printers
add_custom_command(
OUTPUT hip_ostream_ops.h
- COMMAND ${CMAKE_C_COMPILER} "$<$<BOOL:${HIP_INCLUDE_DIRECTORIES}>:-I$<JOIN:${HIP_INCLUDE_DIRECTORIES},$<SEMICOLON>-I>>"
+ COMMAND ${CMAKE_C_COMPILER} -nostdinc++ -isystem ${SYSTEM_HEADERS_DIR} "$<$<BOOL:${HIP_INCLUDE_DIRECTORIES}>:-I$<JOIN:${HIP_INCLUDE_DIRECTORIES},$<SEMICOLON>-I>>"
-E "${CMAKE_CURRENT_SOURCE_DIR}/roctracer/hip_full_api.h" -D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o hip_runtime_api.h.i
BYPRODUCTS hip_runtime_api.h.i
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/script/gen_ostream_ops.py

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>sci@gentoo.org</email>
<name>Gentoo Science Project</name>
</maintainer>
<maintainer type="person" proxied="yes">
<email>xgreenlandforwyy@gmail.com</email>
<name>Yiyang Wu</name>
</maintainer>
<maintainer type="person" proxied="yes">
<email>gentoo@holzke.net</email>
<name>Wilfried Holzke</name>
</maintainer>
<maintainer type="person">
<email>lockalsash@gmail.com</email>
<name>Sv. Lockal</name>
</maintainer>
<upstream>
<remote-id type="github">ROCm/roctracer</remote-id>
</upstream>
</pkgmetadata>

View file

@ -1,87 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
LLVM_MAX_SLOT=17
ROCM_VERSION=${PV}
inherit cmake prefix python-any-r1 rocm llvm
DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's"
HOMEPAGE="https://github.com/ROCm-Developer-Tools/roctracer"
SRC_URI="https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/roctracer-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="dev-libs/rocr-runtime
dev-util/hip"
DEPEND="${RDEPEND}"
BDEPEND="
$(python_gen_any_dep '
dev-python/cppheaderparser[${PYTHON_USEDEP}]
dev-python/ply[${PYTHON_USEDEP}]
')
"
PATCHES=(
"${FILESDIR}"/roctracer-5.7.1-with-tests.patch
)
python_check_deps() {
python_has_version "dev-python/cppheaderparser[${PYTHON_USEDEP}]" \
"dev-python/ply[${PYTHON_USEDEP}]"
}
src_prepare() {
cmake_src_prepare
hprefixify script/*.py
eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.3.3-rocm-path.patch)
# Install libs directly into /usr/lib64
sed -e 's:${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}:${CMAKE_INSTALL_LIBDIR}:g' \
-i src/CMakeLists.txt plugin/file/CMakeLists.txt || die
# Remove all install commands for tests
sed -E '/^ *install\(.+/d' -i test/CMakeLists.txt || die
# Fix search path for HIP cmake
sed -e "s,\${ROCM_PATH}/lib/cmake,/usr/$(get_libdir)/cmake,g" -i test/CMakeLists.txt || die
}
src_configure() {
local mycmakeargs=(
-DCMAKE_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/cmake/hip"
-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
-DWITH_TESTS=$(usex test)
)
use test && mycmakeargs+=(
-DCMAKE_FIND_DEBUG_MODE=ON
-DHIP_ROOT_DIR="${EPREFIX}/usr"
-DHIP_CLANG_INSTALL_DIR="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin"
-DGPU_TARGETS="$(get_amdgpu_flags)"
)
cmake_src_configure
}
src_test() {
check_amdgpu
cd "${BUILD_DIR}" || die
# if LD_LIBRARY_PATH not set, dlopen cannot find correct lib
LD_LIBRARY_PATH="${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" bash run.sh || die
}
src_install() {
cmake_src_install
# remove unneeded copy
rm -r "${ED}/usr/share/doc/${PF}-asan" || die
}

View file

@ -1,108 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
LLVM_COMPAT=( 20 )
ROCM_VERSION=${PV}
inherit cmake flag-o-matic llvm-r1 prefix python-any-r1 rocm toolchain-funcs
DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's"
HOMEPAGE="https://github.com/ROCm/roctracer"
SRC_URI="https://github.com/ROCm/roctracer/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/roctracer-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="
dev-util/hip:${SLOT}
dev-libs/rocr-runtime
"
DEPEND="${RDEPEND}"
BDEPEND="
$(python_gen_any_dep '
dev-python/cppheaderparser[${PYTHON_USEDEP}]
dev-python/ply[${PYTHON_USEDEP}]
')
"
PATCHES=(
"${FILESDIR}"/roctracer-5.7.1-with-tests.patch
)
python_check_deps() {
python_has_version "dev-python/cppheaderparser[${PYTHON_USEDEP}]" \
"dev-python/ply[${PYTHON_USEDEP}]"
}
pkg_setup() {
python-any-r1_pkg_setup
llvm-r1_pkg_setup
}
src_prepare() {
cmake_src_prepare
hprefixify script/*.py
eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.3.3-rocm-path.patch)
# Install libs directly into /usr/lib64
sed -e 's:${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}:${CMAKE_INSTALL_LIBDIR}:g' \
-i src/CMakeLists.txt plugin/file/CMakeLists.txt || die
# Remove all install commands for tests
sed -E '/^ *install\(.+/d' -i test/CMakeLists.txt || die
# Fix search path for HIP cmake
sed -e "s,\${ROCM_PATH}/lib/cmake,/usr/$(get_libdir)/cmake,g" -i test/CMakeLists.txt || die
# bug #892732
sed -i -e 's/-Werror//' CMakeLists.txt || die
# libc++ may have no experimental/filesystem
sed -e 's|experimental/||' -e 's|experimental::||' \
-i plugin/file/file.cpp src/hip_stats/hip_stats.cpp \
src/roctracer/loader.h src/tracer_tool/tracer_tool.cpp || die
}
src_configure() {
rocm_use_hipcc
if [[ $(tc-get-cxx-stdlib) == "libc++" ]] ; then
# https://releases.llvm.org/9.0.0/projects/libcxx/docs/UsingLibcxx.html#using-filesystem
append-libs "-lc++fs"
fi
local mycmakeargs=(
-DCMAKE_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/cmake/hip"
-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
-DWITH_TESTS=$(usex test)
-DPython3_EXECUTABLE="${PYTHON}"
)
use test && mycmakeargs+=(
-DHIP_ROOT_DIR="${EPREFIX}/usr"
-DGPU_TARGETS="$(get_amdgpu_flags)"
)
cmake_src_configure
}
src_test() {
check_amdgpu
cd "${BUILD_DIR}" || die
# if LD_LIBRARY_PATH not set, dlopen cannot find correct lib
LD_LIBRARY_PATH="${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" bash run.sh || die
}
src_install() {
cmake_src_install
# remove unneeded copy
rm -r "${ED}/usr/share/doc/${PF}-asan" || die
}

View file

@ -1,110 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
ROCM_VERSION=${PV}
inherit cmake flag-o-matic prefix python-any-r1 rocm toolchain-funcs
DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's"
HOMEPAGE="https://github.com/ROCm/roctracer"
SRC_URI="https://github.com/ROCm/roctracer/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/roctracer-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="
dev-util/hip:${SLOT}
dev-libs/rocr-runtime
"
DEPEND="${RDEPEND}"
BDEPEND="
$(python_gen_any_dep '
dev-python/cppheaderparser[${PYTHON_USEDEP}]
dev-python/ply[${PYTHON_USEDEP}]
')
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-with-tests.patch"
"${FILESDIR}/${PN}-6.3.0-fix-prettyprinter.patch"
)
python_check_deps() {
python_has_version "dev-python/cppheaderparser[${PYTHON_USEDEP}]" \
"dev-python/ply[${PYTHON_USEDEP}]"
}
pkg_setup() {
python-any-r1_pkg_setup
}
src_prepare() {
cmake_src_prepare
hprefixify script/*.py
eapply $(prefixify_ro "${FILESDIR}/${PN}"-5.3.3-rocm-path.patch)
# Install libs directly into /usr/lib64
sed -e "s:\${CMAKE_INSTALL_LIBDIR}/\${PROJECT_NAME}:\${CMAKE_INSTALL_LIBDIR}:g" \
-i src/CMakeLists.txt plugin/file/CMakeLists.txt || die
# Remove all install commands for tests
sed -E '/^ *install\(.+/d' -i test/CMakeLists.txt || die
# Test fails: https://github.com/ROCm/roctracer/issues/109
sed '/load_unload_reload_test/d' -i test/run.sh || die
# Fix search path for HIP cmake
sed -e "s,\${ROCM_PATH}/lib/cmake,/usr/$(get_libdir)/cmake,g" -i test/CMakeLists.txt || die
# bug #892732
sed -e 's/-Werror//' -i CMakeLists.txt || die
# libc++ may have no experimental/filesystem
sed -e 's|experimental/||' -e 's|experimental::||' \
-i plugin/file/file.cpp src/hip_stats/hip_stats.cpp \
src/roctracer/loader.h src/tracer_tool/tracer_tool.cpp || die
}
src_configure() {
rocm_use_hipcc
if [[ $(tc-get-cxx-stdlib) == "libc++" ]] ; then
# https://releases.llvm.org/9.0.0/projects/libcxx/docs/UsingLibcxx.html#using-filesystem
append-libs "-lc++fs"
fi
local mycmakeargs=(
-DCMAKE_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/cmake/hip"
-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
-DWITH_TESTS=$(usex test)
-DPython3_EXECUTABLE="${PYTHON}"
)
use test && mycmakeargs+=(
-DHIP_ROOT_DIR="${EPREFIX}/usr"
-DGPU_TARGETS="$(get_amdgpu_flags)"
)
cmake_src_configure
}
src_test() {
check_amdgpu
cd "${BUILD_DIR}" || die
# if LD_LIBRARY_PATH not set, dlopen cannot find correct lib
LD_LIBRARY_PATH="${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" bash run.sh || die
}
src_install() {
cmake_src_install
# remove unneeded copy
rm -r "${ED}/usr/share/doc/${PF}-asan" || die
}

View file

@ -1,110 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
ROCM_VERSION=${PV}
inherit cmake flag-o-matic prefix python-any-r1 rocm toolchain-funcs
DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's"
HOMEPAGE="https://github.com/ROCm/roctracer"
SRC_URI="https://github.com/ROCm/roctracer/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/roctracer-rocm-${PV}"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="
dev-util/hip:${SLOT}
dev-libs/rocr-runtime
"
DEPEND="${RDEPEND}"
BDEPEND="
$(python_gen_any_dep '
dev-python/cppheaderparser[${PYTHON_USEDEP}]
dev-python/ply[${PYTHON_USEDEP}]
')
"
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-with-tests.patch"
"${FILESDIR}/${PN}-6.3.0-fix-prettyprinter.patch"
)
python_check_deps() {
python_has_version "dev-python/cppheaderparser[${PYTHON_USEDEP}]" \
"dev-python/ply[${PYTHON_USEDEP}]"
}
pkg_setup() {
python-any-r1_pkg_setup
}
src_prepare() {
cmake_src_prepare
hprefixify script/*.py
eapply $(prefixify_ro "${FILESDIR}/${PN}"-5.3.3-rocm-path.patch)
# Install libs directly into /usr/lib64
sed -e "s:\${CMAKE_INSTALL_LIBDIR}/\${PROJECT_NAME}:\${CMAKE_INSTALL_LIBDIR}:g" \
-i src/CMakeLists.txt plugin/file/CMakeLists.txt || die
# Remove all install commands for tests
sed -E '/^ *install\(.+/d' -i test/CMakeLists.txt || die
# Test fails: https://github.com/ROCm/roctracer/issues/109
sed '/load_unload_reload_test/d' -i test/run.sh || die
# Fix search path for HIP cmake
sed -e "s,\${ROCM_PATH}/lib/cmake,/usr/$(get_libdir)/cmake,g" -i test/CMakeLists.txt || die
# bug #892732
sed -e 's/-Werror//' -i CMakeLists.txt || die
# libc++ may have no experimental/filesystem
sed -e 's|experimental/||' -e 's|experimental::||' \
-i plugin/file/file.cpp src/hip_stats/hip_stats.cpp \
src/roctracer/loader.h src/tracer_tool/tracer_tool.cpp || die
}
src_configure() {
rocm_use_hipcc
if [[ $(tc-get-cxx-stdlib) == "libc++" ]] ; then
# https://releases.llvm.org/9.0.0/projects/libcxx/docs/UsingLibcxx.html#using-filesystem
append-libs "-lc++fs"
fi
local mycmakeargs=(
-DCMAKE_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/cmake/hip"
-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
-DWITH_TESTS=$(usex test)
-DPython3_EXECUTABLE="${PYTHON}"
)
use test && mycmakeargs+=(
-DHIP_ROOT_DIR="${EPREFIX}/usr"
-DGPU_TARGETS="$(get_amdgpu_flags)"
)
cmake_src_configure
}
src_test() {
check_amdgpu
cd "${BUILD_DIR}" || die
# if LD_LIBRARY_PATH not set, dlopen cannot find correct lib
LD_LIBRARY_PATH="${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" bash run.sh || die
}
src_install() {
cmake_src_install
# remove unneeded copy
rm -r "${ED}/usr/share/doc/${PF}-asan" || die
}