diff options
Diffstat (limited to 'dev-util/hip')
-rw-r--r-- | dev-util/hip/Manifest | 12 | ||||
-rw-r--r-- | dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch | 35 | ||||
-rw-r--r-- | dev-util/hip/files/hip-5.1.3-clang-include-path.patch | 12 | ||||
-rw-r--r-- | dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch | 38 | ||||
-rw-r--r-- | dev-util/hip/files/hip-5.1.3-rocm-path.patch | 13 | ||||
-rw-r--r-- | dev-util/hip/files/hipvars-5.1.3.pm | 21 | ||||
-rw-r--r-- | dev-util/hip/hip-5.1.3.ebuild | 161 |
7 files changed, 292 insertions, 0 deletions
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest index 1cbe026b76a3..e10dc8f75b58 100644 --- a/dev-util/hip/Manifest +++ b/dev-util/hip/Manifest @@ -1,3 +1,4 @@ +AUX 0001-SWDEV-316128-HIP-surface-API-support.patch 1156 BLAKE2B 52ff9a2389533ac213055ff8c1d4359cbd490f64699233a6c97dbb54ea8216d94039b016b9dcdde7a304662b9ca5c444ac889a6491e847b0a701e0b0cc0e4b59 SHA512 0c210ac60929a951ce1210b1f76e2e6966cc411834a350e6d01d1eb20cb862056cec881a00978cdbe5bfc61e53128c1cd09c6138cca9469213a6bbf425b8686d AUX hip-3.5.1-config-cmake-in.patch 1227 BLAKE2B 5b85ff489232590aa9ddbf8bbf1d5730c8152626e221ce735afcc8b92c3a62e1b2805ed9f3709b3e97b67f787886fd36d685101ea5d3bb76f023dd668b0ebd3d SHA512 0a190ab213ec5ee626843b584c684913ff5cfe0864e443616da7f8f1cf848bc29e46cd7c2d2df6929058acf696f25420267ded69f03862a20b443d107867af74 AUX hip-3.5.1-detect_offload-arch_for_clang-roc.patch 782 BLAKE2B f851798324799d53271db8149ce7538709435a12a607a352989f5ea816d183573cb21ba2c54d507ec8aad242ccbdb06f79113b48ac8d26f51f402066a124ca6a SHA512 bc60f252e5c1df1c453717f2565a41e05014fc259195a7d25db83bc37a52c33eea261a3afbf37b0afaf80d7b1ffbbe02d8f97967556667238929ea6e6df0108d AUX hip-3.5.1-hip_vector_types.patch 247 BLAKE2B 05d17292a61b8ecd6c6cc8bb8075d909885896f6183ffe84882e98066ef9d44d33431a2b12fcbc36db3f0b94713313d5b85918fe041b1102256ac523ac7f8782 SHA512 d02610b59336f332e9025d860977ad27c6d82c35577ecae9b89b253fc911aafc14553ccaa4b667befe4ea7dbe8c55298643dea5e163941c702d35a4f8a594c9d @@ -12,19 +13,29 @@ AUX hip-5.0.1-DisableTest.patch 1689 BLAKE2B dd25393370a594abd3cb6fe8abab6481c2c AUX hip-5.0.1-hip_vector_types.patch 312 BLAKE2B fb5a61a73e741e2456c031adc9c2e96fdccb5b88a3d99e6b4d31a9b53897f6ccbb41c9535296b55512055f0581a394289bae31036d3b7c07a8081e88708b9a19 SHA512 2ab41b46baf0f8adcb82f55b7ebfcfa3097159b7317d2609b490c0406ba47728c37531c03b0a4e474d760776cf7b614e32ccab45c769ce2fb8e54fcdffa61f5a AUX hip-5.0.2-correct-ldflag.patch 1117 BLAKE2B 8d11bc278660fb7e14585822a462de96ebca78bf5cec026c8097fa2b9eef87f3d4fd21641d0cfe77f217067bc161b6ece94eb55de71611f106243c8bd41b157c SHA512 1d4b46f941f5b3115705a416822b2a7c034ca6611a7706bc126902e5130239dcf84624f35624f9c7b952314c1d76fcba3f17e40ceb2574b4b37bddada073f808 AUX hip-5.0.2-set-build-id.patch 741 BLAKE2B 9d4668ab770fd1ebc93a19a3ddc2916e8feb69a95e54ceb5955c4a162733b8899d43f906c86b0b994add22ab46969ff18aad03035e6285a6492bc9c1405bce38 SHA512 714b2f8e791f0e30a7af567e430e2bba38473725e0d96e42de0c97a2ba939fd83b2f233eebf03cb8a6a82d10c46cfa5ea869af97f35c02da38924250a19e660a +AUX hip-5.1.3-clang-include-path.patch 564 BLAKE2B 8cdfbd9eba9c5e642a8e85aa269b0e369ef11a90c30771e0b1ef21d1ff1bfbb6d9f27cc03693b22b39347d939a11994ffbe4dd2f9edc5583811fff273c304307 SHA512 e6d8dda10155a6d269435f37bf8d4fa25b503861450d474cc01c21ea582857caa9ed26ca04e513b12708ae60348cd32296aaf39c805ee3f925e7d6590cae658c +AUX hip-5.1.3-fix-hip_prof_gen.patch 1480 BLAKE2B caa3fa9840a8add5a25daaeb6f26eed9da3fe55686f6343e31b836a0b2e12999cd45d9220469cde036c7914f672b6cc46695fce1bfe4a8d6d35c836cdc14e413 SHA512 a588238cb12dc973acc6513bead68439b10b49214d5dceb81a0498510f79269b79897a02dd9e2ee1ef396a762d49310fd0a406d7f8b6c0e85faeba0f69b1de23 +AUX hip-5.1.3-rocm-path.patch 564 BLAKE2B ad554063a11d58ce5acfa8c8980bac2668d199b059bc2555d4cea40fbc53b6334daaea448d99cc391cee246d8318a450efdef669db2ee164a4db3a55d7d8e193 SHA512 eaa03f4d2394f61dcedde376de6c398625d284a7ac0c94ff2484929efdf298f455c796b96f16bf3989de6593a9a026a7681620b5ca13ce403aba4a32e5a38226 AUX hipvars-5.0.2.pm 590 BLAKE2B b67de8f86bc53d9fbcd50a9cfa9759feb0145f3b3e40360cc322676411e038ff21b8f81265ba27d099e51c3dc55230f87c477cbadfba2b48c08978216f2fbd81 SHA512 0becd625e6f34d687338e25ca4697e68a735a1df60a4c2c53f577e7999a34bc07041f513632f9534aa4b35da2cf50b02c96187f69fd183bff893343257aa85b9 +AUX hipvars-5.1.3.pm 629 BLAKE2B 6149f230aa0756603ac0b455d802db9c698be8e4a22367e98915db974ea16176f85f9b5a22e2572183641734cedbbe2ba2c826aa0223ea3e12c5550983db0480 SHA512 26ba459b13df1ad6dc50411ac6589dd3d17eff727fee0e938275912e36459c7a43b35233a7f78bbed282a992e969d8b8f95007964c810a5954b0abeccc67082d AUX hipvars.pm 598 BLAKE2B 1645b12179195b95757d207248c85b7c8d9eda0347caee5cb48bdc66e85fda517f607bcb69cdfc63657a0db04ad8e96494a0a80268df7c17d6bb0e689325c2e8 SHA512 6c4e71455341673a329b4b0163fefd7f2f4b7d62da3496643d0de096755899c99b3b5a80fffbdf29896c234cb4f617b368217f4eecfd005849b294ff434b79c6 DIST 5.0.2-update-header.patch.gz 5136 BLAKE2B 290b9e250e3004a1147ad28606d7d205078affbd809c6a429744767ebabf35bd8df6395dc135984d345ae2f23fa457dcb2524bcbf31c5bf16903d3ee2007bf5d SHA512 41b1025c403e874026a712ec6f6571c873203b08ddadf68848f6d1f63924c21b206677b330f79edad2c4b85e2ba5053b1d33f70c7c09ff9c17bc5905b849da0c +DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a DIST rocclr-5.0.2.tar.gz 853965 BLAKE2B a0d568eb3b230845970d8256a5a2f32018e4b9fb68e0f1aa13a1f3fc953e614025315b90cbe68c107f7150cf91b4b1ea438455429062c7dc06ef77d65dedd2ec SHA512 b30a57c09973d8ef624511f422babaf9722685b9f85643783aebc000671b41fd54f44b308cece0baab187e1ee00b10335c6d22b6bad6fb3468abe6ef0da97d73 +DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca DIST rocm-hip-4.0.0.tar.gz 1012154 BLAKE2B 02343239a5b27c42dafd241f2c9b6f5195c50f78bfd717ae72bcb16d384bd6cf97ff6f2b86bfcf323aaaf022d6897f46d0987826c80d6f6279be4cb4792e15be SHA512 cf840dbe28a9a15e3be14351bfa22d3c81e1654813a7aee55f53e71b2ee183f8dd0de14a79791617fabb5b357cadbf2ce2f476f78884b2843d30f206d65088f6 DIST rocm-hip-4.1.0.tar.gz 954215 BLAKE2B c4b75ab2158e6921be1c34820ab5d1a5e2eb36112834b0143c50023caa27de384e0497f4837947cc7fe05554c6c95201340b1979eb916b31ebb4ffec8c923735 SHA512 420ffd7b79e2b4506873cbfc56e96395f8ed9d9375ce28df51626601199d4d8dca6920528e255d39a48ad66ee11f4b653f3b9f659df489d32b21886fb86c64b5 DIST rocm-hip-4.2.0.tar.gz 918281 BLAKE2B 45c28289c8ff9e600bfd9daff8af162c897fcfdf41ce65d91d1761d58253d87a6385fd4a15e818619ca39d3413479bf043ab2758fead349a243105e979b64f7c SHA512 e620507321c949ded2eab6159099eef0eab267eb686b6ee0ed86022fffaa51fb8714a7f344b79acf76c876c55919360905d1bb3a7c00a87f40174774d6682ce8 DIST rocm-hip-4.3.0.tar.gz 967550 BLAKE2B 263e8bbaa86198d3cb6a29f5597b56a3fe1e9338a8c485935070e6253816ccdba9671f33d8142c260aa3c36f43a71de7f2c1b7a15e1227f97aaf03ed10ce10dd SHA512 bc2d9597200405397387cc8f626f0cc734ee450c462bd7c7a0c655e3dfe2d1e09780328cbfa1c0d1e0db836e561fc450c5d514a6ad1a5828cb913c4c3c535ef1 DIST rocm-hip-5.0.2.tar.gz 958496 BLAKE2B 9c8bb1eacd982203e3bd6c24560672c4a9aaf5606608635d7da5a60f613d9be50998f990c1ea3e0e6f5581e0efcba09af736a77bbc9469b2898e0974d063e8d6 SHA512 4a99e86a4594c15509a1bbfec0678cd05469eb14dcf35ce650e1eb7c2415f57f59071b1b8add2f8566ccf06242bead77abd275987fe79fe6031dea90d5693805 +DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24 DIST rocm-hipamd-5.0.2.tar.gz 319973 BLAKE2B ca19938eeca66f0d2614ff933e1d0e75b6b8dbc8d996fd4369e5649897b9948271ac88f2a66f0a40ef586d6185b30d01132decac95d1615c1ee419996050ed07 SHA512 056acab082b5073e81f9e5de00ae12c85021d1c297cdcfc45b85f191dcc68603f64fe5d0e75f9523120657947eb125beaa9c3ce26234968c43b200e638f9afa3 +DIST rocm-hipamd-5.1.3.tar.gz 331996 BLAKE2B 176121fe199d53c02a0fc407015681c2f08c8a72104738b457581fd81b37d16efb8170a46d687fb85a45242ba8564246cdd5746e78d9b73dd0bdc9b24eb8378c SHA512 daa6f4da97f71a5fd1f79d8c9e5fc43324743aec91362a05fa62e08966397a637d794abc7e14230eccf5f1271f9fac58d1336aaad1f2cded6cd10792845a494b DIST rocm-opencl-runtime-4.3.0.tar.gz 1006792 BLAKE2B 29fd5843bb0153c7d3fe5250898f0fbdd089db6304122698c9ec9a5436e3a6845916f241f1a1e79a614e369f000297ac12413620edec0660d859ccddaa978d07 SHA512 a514d626700350f2c663db468427479eaa9e39dd912266ac2db6830d712351ffbc18737b208fd37f7ab5afdc2c9f6412d8d765973d6c72759bf51f864fc6bf1d DIST rocm-opencl-runtime-5.0.2.tar.gz 1004855 BLAKE2B e2c2beb987053204fbe8fda562ae65d6c1a58447e9e88bf1081aabeee6c9a10738fd8562114b564b647682438fdbd2c535db1008ac6e1cc4eb9a915998eeb3c7 SHA512 fa01d1fafc890181b9e67070353ee7c9100619494b7509cae1a3659f24ef1d00f650024cb24bdb0e6e7eacfdec1115e4683ec6f320228a19f41ae83321780780 +DIST rocm-opencl-runtime-5.1.3.tar.gz 1004765 BLAKE2B 64d9b42026d2be1d0e4aa666785699f6b4ec0584a927904a94bf830883050943503f8bdd7c97438a2fb11c71686a330d526f633959916c5c6c8da2e037841e79 SHA512 b83c3ae0bfad80f867bacce36710a8964f6dd7e64bf50da3ec6ce842217d6de63299d9ceaab9dc25a22252484520a85d02859809463dad5dda9b1f00a86863e0 DIST rocm-tracer-5.0.2.tar.gz 474669 BLAKE2B b350111590140e1282338e4f134caf6228677c49361ceb9bc7ba0da8709346daa4fd014644c04adff0e903dba6014a84edd2eb3a5c132a8f91b479e4d5b085e5 SHA512 3fc1449cc9c9bf83e5233a7a0e83c0e3fa9da225d5ee4427b7d6fa15e3580497e1b9fbcd63892e4a99df01582aecd3ccfd66d2a19af2d8c25949ee705894ea44 +DIST rocm-tracer-5.1.3.tar.gz 511617 BLAKE2B 4142979b3b7d649798a7ac0b2a04b42aa7fbcbf82f2cf51b0e5363ec0da538046d6e59283d0ce1bfd341317bf24ac2f694d5c8a7d1f132f9b21caea5caf7eda3 SHA512 e73b0c921ffbdcac571d8b0825de39bd8a4fd5f2720ecdd0c189951db85efb607a0b1cd7a9bb02b3dbf329b277cb5e197525216a8e8927eea4e6ce290b7e7c7b EBUILD hip-4.0.0-r1.ebuild 3817 BLAKE2B c01eb20493f27e9650d1cad3413b7fa14ef799d67e8b02de235d1e37a4f6633c8f0f6ea73fa8f075d0a10ffb2dbe0ccba4a65c4a505e665be7d657d5c773641a SHA512 2b5b58f13d832572f547f5ba4e67daf62b180523424e1e4605e96d1b7d834b700f8aebc95b047ab08ba36e16098aa07ddf7f9c91654672b00edc863bb5c25d68 EBUILD hip-4.0.0.ebuild 3451 BLAKE2B c219b26871ab9197ddd75a4d8e03bdb2d6f9c12cc9d8bd4b29e1babceb3572afb5f859288c395952befd8520fdf2875703566a4dd7280045f98f309af8c3756b SHA512 d7b82a954d9dfde559e48dcad266aa7d3cb204442045ea2c3eaeafa7513f0f549ca3a656d5d823e636600e3b9112fd276fbfb9e9ebac74f01024327de76276dd EBUILD hip-4.1.0-r1.ebuild 3366 BLAKE2B c8663bbba532bca211de1a8b8253e2df9544cc656ae47a0d8e651161f7e4186227b9cdc11e3b3b010bbb1d8a18ff36ece37d5a9ad4092ed496f3c9d1e7dc7791 SHA512 fc2145fad2fe1e5a28331a91959c591693cec497504344e6ae2587276d7b20e7895d94780273a0f83307efbb0e6099e0bdc1874bcefa2595590a736092502891 @@ -34,4 +45,5 @@ EBUILD hip-4.3.0-r1.ebuild 3782 BLAKE2B b3f7e96b664662e9cdae955993251af254cd44f6 EBUILD hip-4.3.0-r2.ebuild 3978 BLAKE2B 16ffbeddfdd5c6d0338e5be1fd609272bb4d00e1a5d1530a00a75d82a5882f52fc0bfd97b14bf9042affa4af4617507a5cd1b8d8f90a1f4c8744028ab63b7f38 SHA512 e664a11e69cc4a7629a8f088992d2e26517635d1f4e685d8dac69e74e6f94e8c1f782f09d0f54308b73c134021579a624bfa2ba8ecac3c470ab81cb317dcb67a EBUILD hip-4.3.0.ebuild 3761 BLAKE2B 7fdd7e65a7b1b246ad94a1e5ee37e7c3199f9dcc02df575e774fdbacf9690ac7609f53c122eff5dd87cddf9afd9c4f52d66a5502b3ec311fd6e9db5f3889a895 SHA512 07d8317cae9f7b2f4c179938477eb00ff8d0a136c730bd18582a835c23a8d9934d03824c2bb520c53cb1c2525e26618236b12dfcbfe520612a60c191a1d2947b EBUILD hip-5.0.2-r2.ebuild 4885 BLAKE2B a5b5c0cd40d1ae31d15ba4d774bfc6ce744b06025b08114976b6aa24758f5880eadf0cdd0b483d80469f6afd953beca56bf5dd6e8c79af111bbbe490baa876bb SHA512 00708d55c02c65cba95b009e3e14006901f92ea1ba8a08a32c25996e04613f4d6237c3b9ba0b1e2c237ad8269282fad39e17ef67b2319fb64bbe6ae9654f5748 +EBUILD hip-5.1.3.ebuild 6042 BLAKE2B d57df2bb4a811b42a048f6f9e72ef54b2d567784eb2d6b80416408363c0246a67ae2f83ca0c9e5c76f1834a987b33b6408688a0c6037e34f6a7dc83b11abcc46 SHA512 761bd007526189d308a437781ffada9244c7ee58b29c4ac63cbf8b5b7f1f265b0e5de1e90aff9b799c1aa1bfc53deb368f181b8a1a27d201762379b7a6f3fa73 MISC metadata.xml 597 BLAKE2B cca1b105463e26741aa4bf95c9d85dd582df075795646f633ed5f0d39bace0b07be98f771aa8eb1b89984788249837303b67617e92c4076eb7601611cd2abf6d SHA512 42767156ae0e89b3ce438bfb163161b543e15114838a5c14b4b1c889fe799e44dd9bf9684ee685798a1fc5d2d4c520d3c42c9c74a88178a079ccb634148e0738 diff --git a/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch b/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch new file mode 100644 index 000000000000..14af91f9055b --- /dev/null +++ b/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch @@ -0,0 +1,35 @@ +From 4168c6ded4e54602f6fad8b0a483b20ab7f83cd5 Mon Sep 17 00:00:00 2001 +From: haoyuan2 <Hao.Yuan@amd.com> +Date: Mon, 21 Feb 2022 10:10:04 -0800 +Subject: [PATCH] SWDEV-316128 - HIP surface API support + +remove redundant code in host API + +Change-Id: I8fbf894e858642da4198cc7afd2d2e2f1971e738 +Signed-off-by: YiyangWu <xgreenlandforwyy@gmail.com> +--- + src/hip_surface.cpp | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/hip_surface.cpp b/src/hip_surface.cpp +index 831df321..a8e7f71d 100644 +--- a/src/hip_surface.cpp ++++ b/src/hip_surface.cpp +@@ -1,4 +1,4 @@ +-/* Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. ++/* Copyright (c) 2015 - 2022 Advanced Micro Devices, Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal +@@ -81,8 +81,6 @@ hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, + } + + hipError_t ihipDestroySurfaceObject(hipSurfaceObject_t surfaceObject) { +- HIP_INIT_API(hipDestroySurfaceObject, surfaceObject); +- + if (surfaceObject == nullptr) { + return hipSuccess; + } +-- +2.34.1 + diff --git a/dev-util/hip/files/hip-5.1.3-clang-include-path.patch b/dev-util/hip/files/hip-5.1.3-clang-include-path.patch new file mode 100644 index 000000000000..bf1f2dd32ce5 --- /dev/null +++ b/dev-util/hip/files/hip-5.1.3-clang-include-path.patch @@ -0,0 +1,12 @@ +pass HIP_CLANG_INCLUDE_PATH which is determined by clang -print-resource-dir +=================================================================== +--- HIP-rocm-5.1.3.orig/bin/hipcc.pl ++++ HIP-rocm-5.1.3/bin/hipcc.pl +@@ -105,6 +105,7 @@ $ROCM_PATH = $hipvars::ROCM_PATH; + $HIP_VERSION = $hipvars::HIP_VERSION; + $HSA_PATH = $hipvars::HSA_PATH; + $HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME; ++$HIP_CLANG_INCLUDE_PATH = $hipvars::HIP_CLANG_INCLUDE_PATH; + + if ($HIP_PLATFORM eq "amd") { + # If using ROCclr runtime, need to find HIP_ROCCLR_HOME diff --git a/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch b/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch new file mode 100644 index 000000000000..05b25e7178fa --- /dev/null +++ b/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch @@ -0,0 +1,38 @@ +Backported fb5a64025bb0e10173a1ee4f3475db322b74b594 +fix an issue in hip_prof_gen.py with GLenum. +diff --git a/src/hip_prof_gen.py b/src/hip_prof_gen.py +index bd32d5bf..a3071a75 100755 +--- a/src/hip_prof_gen.py ++++ b/src/hip_prof_gen.py +@@ -81,7 +81,7 @@ def filtr_api_args(args_str): + args_str = re.sub(r'\s*,\s*', r',', args_str); + args_str = re.sub(r'\s+', r' ', args_str); + args_str = re.sub(r'\s*(\*+)\s*', r'\1 ', args_str); +- args_str = re.sub(r'(enum|struct) ', '', args_str); ++ args_str = re.sub(r'(\benum|struct) ', '', args_str); + return args_str + + # Normalizing types +@@ -129,7 +129,9 @@ def pointer_ck(arg_type): + m = re.match(r'(.*)\*$', arg_type) + if m: + ptr_type = m.group(1) +- ptr_type = re.sub(r'const ', '', ptr_type) ++ n = re.match(r'(.*)\*\*$', arg_type) ++ if not n: ++ ptr_type = re.sub(r'const ', '', ptr_type) + if ptr_type == 'void': ptr_type = '' + return ptr_type + ############################################################# +@@ -613,7 +615,7 @@ if (len(sys.argv) < 4): + " -p - HIP_INIT_API macro patching mode\n" + + "\n" + + " Example:\n" + +- " $ " + sys.argv[0] + " -v -p -t --priv ./include/hip/amd_detail/hip_runtime_api.h" + ++ " $ " + sys.argv[0] + " -v -p -t --priv ../hip/include/hip/hip_runtime_api.h" + + " ./src ./include/hip/amd_detail/hip_prof_str.h ./include/hip/amd_detail/hip_prof_str.h.new"); + + # API header file given as an argument +-- +2.34.1 + diff --git a/dev-util/hip/files/hip-5.1.3-rocm-path.patch b/dev-util/hip/files/hip-5.1.3-rocm-path.patch new file mode 100644 index 000000000000..2ce68b733577 --- /dev/null +++ b/dev-util/hip/files/hip-5.1.3-rocm-path.patch @@ -0,0 +1,13 @@ +explicitly specify `--rocm-path=/usr` because clang does not list +it among the default paths +=================================================================== +--- HIP-rocm-5.1.3.orig/bin/hipcc.pl ++++ HIP-rocm-5.1.3/bin/hipcc.pl +@@ -696,6 +696,7 @@ if ($HIP_PLATFORM eq "amd") { + + if ($hasHIP) { + if ($DEVICE_LIB_PATH ne "$ROCM_PATH/amdgcn/bitcode") { ++ $HIPCXXFLAGS .= " --rocm-path=\"$ROCM_PATH\""; + $HIPCXXFLAGS .= " --hip-device-lib-path=\"$DEVICE_LIB_PATH\""; + } + $HIPCXXFLAGS .= " -fhip-new-launch-api"; diff --git a/dev-util/hip/files/hipvars-5.1.3.pm b/dev-util/hip/files/hipvars-5.1.3.pm new file mode 100644 index 000000000000..7de38b7f3c78 --- /dev/null +++ b/dev-util/hip/files/hipvars-5.1.3.pm @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w +package hipvars; + +$HIP_BASE_VERSION_MAJOR = "@HIP_BASE_VERSION_MAJOR@"; +$HIP_BASE_VERSION_MINOR = "@HIP_BASE_VERSION_MINOR@"; + +$isWindows = 0; +$HIP_PATH='/usr'; +$ROCM_PATH='/usr'; +$CUDA_PATH='/opt/cuda'; +$HSA_PATH='/usr'; +$HIP_CLANG_PATH='@CLANG_PATH@'; +$HIP_CLANG_INCLUDE_PATH='@CLANG_INCLUDE_PATH@'; +$HIP_ROCCLR_HOME=$HIP_PATH; +$HIP_PLATFORM='amd'; +$HIP_COMPILER = "clang"; +$HIP_RUNTIME = "rocclr"; +$HIP_VERSION_MAJOR = $HIP_BASE_VERSION_MAJOR; +$HIP_VERSION_MINOR = $HIP_BASE_VERSION_MINOR; +$HIP_VERSION_PATCH = "@HIP_VERSION_PATCH@"; +$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH"; diff --git a/dev-util/hip/hip-5.1.3.ebuild b/dev-util/hip/hip-5.1.3.ebuild new file mode 100644 index 000000000000..a9e9844fdcc2 --- /dev/null +++ b/dev-util/hip/hip-5.1.3.ebuild @@ -0,0 +1,161 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) + +inherit cmake llvm prefix python-any-r1 + +LLVM_MAX_SLOT=14 + +DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability" +HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd" +SRC_URI="https://github.com/ROCm-Developer-Tools/hipamd/archive/rocm-${PV}.tar.gz -> rocm-hipamd-${PV}.tar.gz + https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz + https://github.com/ROCm-Developer-Tools/ROCclr/archive/rocm-${PV}.tar.gz -> rocclr-${PV}.tar.gz + https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz + profile? ( https://github.com/ROCm-Developer-Tools/roctracer/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz + https://github.com/ROCm-Developer-Tools/hipamd/files/8991181/hip_prof_str_diff.gz -> ${P}-update-header.patch.gz + )" + +KEYWORDS="~amd64" +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" + +IUSE="debug profile" + +DEPEND=" + >=dev-util/rocminfo-5 + sys-devel/clang:${LLVM_MAX_SLOT} + dev-libs/rocm-comgr:${SLOT} + virtual/opengl +" +RDEPEND="${DEPEND} + dev-perl/URI-Encode + sys-devel/clang-runtime:= + >=dev-libs/roct-thunk-interface-5" +BDEPEND="profile? ( $(python_gen_any_dep ' + dev-python/CppHeaderParser[${PYTHON_USEDEP}] + ') ) +" + +PATCHES=( + "${FILESDIR}/${PN}-5.0.1-DisableTest.patch" + "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch" + "${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch" + "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch" + "${FILESDIR}/${PN}-5.0.2-set-build-id.patch" + "${FILESDIR}/${PN}-5.1.3-fix-hip_prof_gen.patch" + "${FILESDIR}/0001-SWDEV-316128-HIP-surface-API-support.patch" +) + +python_check_deps() { + if use profile; then + has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]" + fi +} + +S="${WORKDIR}/hipamd-rocm-${PV}" +HIP_S="${WORKDIR}"/HIP-rocm-${PV} +OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV} +CLR_S="${WORKDIR}"/ROCclr-rocm-${PV} +RTC_S="${WORKDIR}"/roctracer-rocm-${PV} + +src_prepare() { + cmake_src_prepare + use profile && eapply "${WORKDIR}/${P}-update-header.patch" + + eapply_user + + # Use Gentoo slot number, otherwise git hash is attempted in vain. + sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die + + # disable PCH, because it results in a build error in ROCm 4.0.0 + sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die + + # correctly find HIP_CLANG_INCLUDE_PATH using cmake + local LLVM_PREFIX="$(get_llvm_prefix "${LLVM_MAX_SLOT}")" + local CLANG_RESOURCE_DIR=$("${LLVM_PREFIX}/bin/clang" -print-resource-dir) + sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":${LLVM_PREFIX}:" -i hip-config.cmake.in || die + + # correct libs and cmake install dir + sed -e "/LIB_INSTALL_DIR/s:PREFIX}/lib:PREFIX}/$(get_libdir):" \ + -e "/${HIP_COMMON_DIR}\/cmake DESTINATION/s: .): $(get_libdir)):" -i CMakeLists.txt || die + sed -e "/LIBRARY DESTINATION/s:lib:$(get_libdir):" -i src/CMakeLists.txt || die + + sed -e "/\.hip/d" \ + -e "s,DESTINATION lib,DESTINATION $(get_libdir),g" \ + -e "/\(cmake\|samples\)/s,DESTINATION \.,DESTINATION share,g" \ + -e "/CPACK_RESOURCE_FILE_LICENSE/d" -i packaging/CMakeLists.txt || die + + pushd ${HIP_S} || die + eapply "${FILESDIR}/${PN}-5.1.3-clang-include-path.patch" + eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch" + eapply "${FILESDIR}/${PN}-5.0.2-correct-ldflag.patch" + # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include" + # which makes "stdlib.h" not found when using "#include_next" in header files; + sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \ + -e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \ + -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \ + -e "s:\$ENV{'HIP_LIB_PATH'}:'/usr/$(get_libdir)':" \ + -e "/rpath/s,--rpath=[^ ]*,," \ + -e "s,\$HIP_CLANG_PATH/../lib/clang/\$HIP_CLANG_VERSION/,${CLANG_RESOURCE_DIR}/,g" \ + -i bin/hipcc.pl || die + + # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs" + sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \ + -i "${S}/hip-config.cmake.in" || die + + einfo "prefixing hipcc and its utils..." + hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}") + hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${HIP_S}") + + cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.1.3.pm)" bin/hipvars.pm || die "failed to replace hipvars.pm" + sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \ + -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," \ + -e "s,@CLANG_INCLUDE_PATH@,${CLANG_RESOURCE_DIR}/include," \ + -e "s,@CLANG_PATH@,${LLVM_PREFIX}/bin," -i bin/hipvars.pm || die + + sed -e "/HIP_CLANG_INCLUDE_SEARCH_PATHS/s,\${_IMPORT_PREFIX}.*/include,${CLANG_RESOURCE_DIR}/include," -i hip-lang-config.cmake.in || die + popd || die + sed -e "/HIP_CLANG_INCLUDE_SEARCH_PATHS/s,\${HIP_CLANG_ROOT}.*/include,${CLANG_RESOURCE_DIR}/include," -i hip-config.cmake.in || die +} + +src_configure() { + use debug && CMAKE_BUILD_TYPE="Debug" + + # TODO: Currently a GENTOO configuration is build, + # this is also used in the cmake configuration files + # which will be installed to find HIP; + # Other ROCm packages expect a "RELEASE" configuration, + # see "hipBLAS" + local mycmakeargs=( + -DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")" + -DCMAKE_BUILD_TYPE=${buildtype} + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DCMAKE_SKIP_RPATH=ON + -DBUILD_HIPIFY_CLANG=OFF + -DHIP_PLATFORM=amd + -DHIP_COMPILER=clang + -DROCM_PATH="${EPREFIX}/usr" + -DUSE_PROF_API=$(usex profile 1 0) + -DROCCLR_PATH=${CLR_S} + -DHIP_COMMON_DIR=${HIP_S} + -DAMD_OPENCL_PATH=${OCL_S} + ) + + use profile && mycmakeargs+=( -DPROF_API_HEADER_PATH="${RTC_S}"/inc/ext ) + + cmake_src_configure +} + +src_install() { + + cmake_src_install + + rm "${ED}/usr/include/hip/hcc_detail" || die + + # Don't install .hipInfo and .hipVersion to bin/lib + rm "${ED}/usr/lib/.hipInfo" "${ED}/usr/bin/.hipVersion" || die +} |