Commit Graph

13474 Commits

Author SHA1 Message Date
Joseph Greathouse 44b16df84f Fix maxSharedMemoryPerMultiProcessor attribute (#1927)
The maxSharedMemoryPerMultiProcessor attribute is meant to describe
the number of bytes of shared memory (LDS space in AMD terminology)
in each SM (CU in AMD terminology). For instance, on AMD GPUs this
is often 64KB per CU, and some Nvidia GPUs it's 96KB per SM.

This shared memory is a different address space from the normal
global memory. However, the current HIP-HCC properties fill this
in with a size that matches the totalGlboalMem property. This gives
a drastically too-high calculation for the amount of LDS space that
each CU has -- tens of GBs vs. 10s of KBs.

This patch fixes this by pulling the maxSharedMemoryPerMultiProcessor
property from the HSA pool that describes how much workgroup-local
space is available on each CU. The HSA runtime eventually pulls
this from the topology information about LDSSizeInKB, defined as
"Size of Local Data Store in Kilobytes per SIMD".

Previously, this HSA query was used to fill in the value of the
sharedMemPerBlock property. On today's AMD GPUs, we know that
the amount of LDS avaialble to the workgroup is identical to the
amount of LDS space in the CU. However, in the future this may
differ. As such, this patch changes around the order and fills
in the "PerMultiProcessor" property from the HSA query (since
what's what the query is defined to return), and then separately
fills in the "PerBlock" property as we know it.
2020-03-17 14:00:51 +05:30
Joseph Greathouse 6ae1b1a321 Fix errors in occupancy calculation function (#1926)
Fix two errors in hipOccupancyMaxActiveBlocksPerMultiprocessor.
1) Fix a possible segfault if the user passed in a null pointer for
   the numBlocks value.
2) Handle the situation when the user is asking for a block size
   that is larger than what the target device can hold within a
   single block.
2020-03-17 14:00:38 +05:30
Yaxun (Sam) Liu 6b1956d139 Let hipcc not pass -mllvm option to HIP-Clang on Windows (#1924)
Currently there is a clang bug on Windows causing duplicate -mllvm options in clang -cc1.

Tempoarily disable -mllvm options for HIP-Clang on Windows until the bug is fixed.

Change-Id: I3a4393ba7745989398dc6c6001722837dad18704
2020-03-17 14:00:20 +05:30
Maneesh Gupta e8bd9768d1 Annotate __constant__ (#1901) 2020-03-17 13:59:44 +05:30
mhbliao fc223dc584 [hip] Improve the portability of the header for vector type support. (#1873)
- Need to check the availability of `__has_attribute` builtin macro
  instead of compiler versions. That's more reliable and portable among
  various compilers.
- Provides a very basic support of vectors for unknown compilers.
2020-03-17 13:59:24 +05:30
Jatin fa10ee3301 Enable saxpy Test
Change-Id: Iadb5f631e1cebaf016b1835510771b3b7fac0a55
2020-03-17 01:15:20 -04:00
Sameer Sahasrabuddhe d48738856c SWDEV-204784: separate printf declaration for vdi/clang
There are now two implementations of printf in HIP:

1. The implemenation for HCC is controlled by the HC_FEATURE_PRINTF
   macro, and it works only with the HCC compiler used in combination
   with the HCC runtime.

2. The implementation for hip-clang requires the VDI runtime, and is
   always enabled with that combination.

Change-Id: Ibaeda7900ffe2ce602ca0094aafed0f1147ac2b6
2020-03-16 04:00:39 -04:00
Vladislav Sytchenko 52046e41b2 SWDEV-224023
Correct typo.

Change-Id: I72131a6e0210e7b961e586cd0ae18608d21fc529
2020-03-15 16:37:25 -04:00
Vladislav Sytchenko dafed1a009 Enable simpleTexture3D test for VDI
Change-Id: Ida65de6e1cae64ac97b624eaab1340877a6fba73
2020-03-13 18:34:39 -04:00
Chauncey Hui 8d91d8fd32 SWDEV-2 - Change OpenCL version number from 3108 to 3109 2020-03-13 03:00:03 -04:00
Jason Tang 9cfb973c3f SWDEV-207312 - Fix images_write_cube failure for gfx10
Change-Id: I7f6a8c77eb712103e4c0a5f36bba95093ffbff98
2020-03-12 17:25:52 -04:00
Saleel Kudchadker f663c93cd6 libhiprtc.so needs to be installed in DEST dir
Change-Id: I3ae8b4f18a05a707b87fa73873c1721928ebe904
2020-03-12 12:23:36 -07:00
German Andryeyev 25c29a99b1 SWDEV-79445 - Remove cl_amd_object_metadata extension
Change-Id: I0dd3d8a249b407dd9fac4ef32ebe9b14fd5ff859
2020-03-12 15:14:01 -04:00
German Andryeyev f7c95a7ec5 SWDEV-86035 - Switch PAL version to 572
Change-Id: I948bcfdb247a9d2d10c4089fd40d184f8999501b
2020-03-12 14:27:02 -04:00
German Andryeyev ab85674f8a SWDEV-224471 - [19H1][Polaris10][Acer]
Test window will quit or show error message when run OpenCL API.

Add a workaround for the race condition with the first page
during pinning.

Change-Id: I9a27b4e173cf94c84aefcb94e255f11169453d94
2020-03-12 14:20:48 -04:00
Jiabao Xie f81175c3bc Cleaned include statements and deleted unnecessary operator overloads
Change-Id: I5eb322c05082e8f27584446af2f6a19243dc63c9
2020-03-12 14:13:01 -04:00
Evgeny Mankov bf385d8641 Merge pull request #1916 from asalmanp/refactor_cooperative_APIs
[HIP] Refactor cooperative APIs
2020-03-12 19:12:50 +03:00
Evgeny Mankov 21ccb0be01 Merge pull request #1908 from asalmanp/prop_mulit_coop
[HIP] add hip specific properties for cooperative kernel multi device
2020-03-12 19:12:11 +03:00
Alex Voicu b9544eabe8 Merge branch 'master' of https://github.com/ROCm-Developer-Tools/HIP into feature_robust_constant 2020-03-12 14:20:26 +00:00
Payam 1b6f21ad9a removing AMD emails per palamida scan
Change-Id: If7307f5b1f81a43f2725ec5abd3b8989cbddbcc5
2020-03-11 21:26:55 -04:00
Saleel Kudchadker 7d86f10c3c Merge "Fix P4 linux make builds" into amd-master-next 2020-03-11 16:17:18 -04:00
Maneesh Gupta af933d0900 Expose support for non-returning atomic FADD (#1909)
Change-Id: If5359488324477315a9bd4f308a75f606c065b39
2020-03-11 14:33:15 +05:30
srinivamd 32960ab8f9 return hipSuccess when count is zero (#1900) 2020-03-11 14:32:54 +05:30
Chauncey Hui c1d1fdd678 SWDEV-2 - Change OpenCL version number from 3107 to 3108 2020-03-11 03:00:03 -04:00
Evgeny Mankov 925d76ddef Merge pull request #1925 from arghdos/patch-3
Fix incorrect shfl_xor for Windows
2020-03-11 00:58:11 +03:00
Jiabao Xie 214c07a5b8 Merge "Structs expanded to print struct information than address. Moved to hip_formatting.hpp. Reformatted to follow Google standards" into amd-master-next 2020-03-10 15:56:49 -04:00
Aryan Salmanpour 70ef268add [HIP] return an error if blockDim exceeds maxThreadsPerBlock 2020-03-10 15:26:53 -04:00
Evgeny Mankov e605bce913 Merge pull request #1922 from emankov/HIP
[HIP][doc] Update README.md
2020-03-10 22:20:00 +03:00
Yaxun Liu 3fbd8e0dc2 Merge "Let hipcc not pass -mllvm option to HIP-Clang on Windows" into amd-master-next 2020-03-10 14:12:06 -04:00
Vladislav Sytchenko caea3f9b32 Fix typo in device __shfl_xor function
Change-Id: I8bcdd53ced00c596a0af013a0c34e37aa67c93ae
2020-03-10 13:23:08 -04:00
Jiabao Xie 10d90ab2ad Structs expanded to print struct information than address. Moved to hip_formatting.hpp. Reformatted to follow Google standards
Change-Id: I08695058c11db51b9f3cbe1deb4af944ebf9e64d
2020-03-10 13:12:28 -04:00
Yaxun (Sam) Liu e796a1ed78 Let hipcc not pass -mllvm option to HIP-Clang on Windows
Currently there is a clang bug on Windows causing duplicate -mllvm options in clang -cc1.

Tempoarily disable -mllvm options for HIP-Clang on Windows until the bug is fixed.

Change-Id: I3a4393ba7745989398dc6c6001722837dad18704
2020-03-10 13:07:26 -04:00
Nick Curtis a9af4755cb Fix incorrect shfl_xor for Windows
copy/paste error, need __shfl_xor w/ lane_mask
2020-03-10 12:04:05 -05:00
German Andryeyev c6d3aea572 SWDEV-79445 - Fix a regression in Linux
PAL doesn't report queue priorities under Linux

Change-Id: I3e1632ee2bcbbbaf52b45565f6b6aec24c559922
2020-03-10 12:39:56 -04:00
Evgeny Mankov 2bb166503f [HIP][doc] Update README.md 2020-03-10 18:04:01 +03:00
Evgeny Mankov 31b1d5e4a4 Merge pull request #1919 from ssahasra/declare-printf
separate printf declaration for vdi/clang
2020-03-10 12:26:54 +03:00
Saleel Kudchadker 7bba326ed1 Fix P4 linux make builds
Change-Id: I6cc4e69a914389b53bc3b52535eb6faf24897a09
2020-03-10 00:02:10 -07:00
Chauncey Hui 17b8565629 SWDEV-2 - Change OpenCL version number from 3106 to 3107 2020-03-10 03:00:02 -04:00
Saleel Kudchadker 8d05d06dce Merge "Change HIPRTC Version to 9.0" into amd-master-next 2020-03-09 22:55:27 -04:00
Vladislav Sytchenko 305e4eedcf Merge "Add hipDrvMemcpy3D." into amd-master-next 2020-03-09 18:13:16 -04:00
Julia Jiang 9b436779e4 Merge "SWDEV-225337-Fix test failure in hipNormalizedFloatValueTex kernel" into amd-master-next 2020-03-09 16:58:10 -04:00
Vladislav Sytchenko cd76eb7486 Add hipDrvMemcpy3D.
This is the equivalent of cuMemcpy3D.

Change-Id: Ib2e06dbd6f5093c931cdfd36c87617f32acffc2d
2020-03-09 16:11:25 -04:00
Aryan Salmanpour 7009901fe0 [HIP] fix formatting/code clean up and fix a bug 2020-03-09 16:03:59 -04:00
jujiang 09d442d7c3 SWDEV-225337-Fix test failure in hipNormalizedFloatValueTex kernel
Change-Id: I3a4c3b58578703993640a8d28242ec1a0ed5ff60
2020-03-09 15:21:29 -04:00
Sameer Sahasrabuddhe 5fc32755b7 enable hostcall tests
Change-Id: Ic6efe71c868defc53be214acd7e0907109ec1410
2020-03-09 14:41:37 -04:00
Saleel Kudchadker f34d5bdfb1 Change HIPRTC Version to 9.0
Change-Id: I7e88df61248f0fe6e33c2315805f9e49a493cf29
2020-03-09 11:28:55 -07:00
Saleel Kudchadker 514c7c8ef8 Fix HIPRTC headers to export C style symbols
Change-Id: I3e0d2b19ace4a9096e3e46bd22f420483da51a8a
2020-03-09 14:18:46 -04:00
Vladislav Sytchenko a15e895cfd Fix Windows build.
extern "C" on Windows implies nothrow. We shouldn't be throwing exceptions either way.

Change-Id: If0ed1f7ec194bf7f65b7cea1a5c250e768a8f190
2020-03-09 11:46:55 -04:00
German Andryeyev 288967eff4 SWDEV-193956 - Fix a regression in OCL for user events
- Check the queue for nullptr, since the user events may not have
a queue, associated with them

Change-Id: Ib969a052acc9108ca3fd0c063157fe4d47c5b244
2020-03-09 11:10:23 -04:00
Chauncey Hui 5a153ed2cf SWDEV-2 - Change OpenCL version number from 3105 to 3106 2020-03-09 03:00:03 -04:00