Commit Graph

49 Commits

Author SHA1 Message Date
Christophe Paquot e97106dda4 Revert "Call notifyCmdQueue when building the event wait list"
This reverts commit 9263f193d0.

Reason for revert: better fix in ROCclr

Change-Id: I9707e69adf42a662c08fe9b3ec7458655d838bdd


[ROCm/hip commit: 7e57136aba]
2020-05-28 17:01:10 -04:00
kjayapra-amd cdd32d1fd0 SWDEV-233927 - Crash if binary for current device is not found.
Change-Id: I57281ae6c09110f39155664fca5a83ea57bb62b4


[ROCm/hip commit: 0599855f0d]
2020-05-28 16:18:27 -04:00
Joseph Greathouse 6690e7a9e0 Fix a build error on signed/unsigned comparison
Change-Id: Ic79eb4c3ec5c6fd36cea7c4810d990619f08b9e1


[ROCm/hip commit: 1f25e4956c]
2020-05-28 14:27:16 -05:00
kjayapra-amd 7002be9c95 SWDEV-236465 - Return error code as soon as global creation fails.
Change-Id: I790b8b4fdd6ab8818bc5b6b9a79e6900b840372d


[ROCm/hip commit: db972c4f2a]
2020-05-28 13:28:23 -04:00
Joseph Greathouse 72de06128e Fix occupancy calculation functions in ROCclr path
The hipOccupancyMaxPotentialBlockSize API is meant to return the
number of threads for the highest-occupancy workgroup, and the number
of those workgroups. It was previously calculating the number of
maximum-sized workgroups that would fit on a single CU. This is
a mixture of the API we wanted (to calculate max potential block size)
and the MaxBlocksPerMultiprocessor function.

This patch fixes it up so that the internal occupancy calculation
function works for two uses: the traditional function that calculates
the maximum blocks per multiprocessor when a user passes in a fixed
block size (used for hipMaxBlocksPerMultiprocessor style functions)
and a function that calculates the size of a block that would lead
to maximum occupancy, and how many blocks of that size would be
needed to fill the whole GPU (for hipOccupancyMaxPotentialBlockSize
style functions).

This also updates the occupancy calculation function to prepare for
gfx10, which does not have SGPR-based occupancy limits.

Change-Id: Ie007b3f9d5ebc4e166b50a3a051498af35650f35


[ROCm/hip commit: ebe5054e04]
2020-05-28 10:22:10 -05:00
Evgeny 14b9967374 adding hipKernelNameRefByPtr function
Change-Id: Iefc18967b10394b85a207ffdb5bbfe5e3601474d


[ROCm/hip commit: ef7ff69ff0]
2020-05-28 10:59:48 -04:00
Saleel Kudchadker 3c9945976e Fix elapsed time calculation for null stream
SWDEV-237377 - This fixes time calculation where the event may
be recorded on Null stream and work submitted on other streams

Change-Id: Ie36310dea5cee2fed4a514ed01f04db4b47e571c


[ROCm/hip commit: fb2d7bcd2b]
2020-05-27 18:42:07 -04:00
Christophe Paquot 9263f193d0 Call notifyCmdQueue when building the event wait list
SWDEV-237846

Change-Id: I8bf70e7ad19903767a080d8c6e516c83b0dc2545


[ROCm/hip commit: 3ba07f5e3c]
2020-05-27 12:53:46 -04:00
Christophe Paquot 3f6aa846a4 hipDeviceSynchronize needs to sync NonBlocking streams as well
SWDEV-237167

Change-Id: Ie916d8f03ce91e8ef05a2b4edc580a7021520f6f


[ROCm/hip commit: f7ed87b02b]
2020-05-26 17:59:22 -04:00
Evgeny d55d242eb7 hip_prof: fixing printing pointer args
Change-Id: I93969723650f7c29d5c00a3809d3701c6a3dca44


[ROCm/hip commit: f9e086ae8a]
2020-05-25 13:17:16 -04:00
kjayapra-amd 542c7874a7 SWDEV - 237467 - Return proper hip error codes incase of ROCclr IPC API failures.
Change-Id: I2cc8da543f70bb3d8b82520fa9b2f509d20ce3c0


[ROCm/hip commit: b44ae437bc]
2020-05-23 10:51:37 -04:00
Dittakavi Satyanvesh 142f3e859b hipIpcCloseMemHandle checks the status of IpcDetach
Change-Id: Ifbe8e5bbda610a1007f881627d0da1c874d03682


[ROCm/hip commit: c068778062]
2020-05-23 08:47:36 -04:00
Matt Arsenault 7e55714dd5 Remove ROCclr search hacks
find_package should now be the only way to import ROCclr. Also update
the build example comment.

The build scripts used 2 custom variables to manually specify the
build and source directories for where to find VDI. Once renamed to
ROCclr, these conflicted with the variables automatically set by
find_package(ROCclr). These hacks tried to satisfy this intermediate
step to try satisfying commit ordering problems to get through PSDB.

The INSTALL.md documentation should also be updated, but it's
completely missing any mention of ROCclr now, and still gives
directions for hcc.

Change-Id: I6fc94b6cb36241a9d4f22d24e49523367f803461


[ROCm/hip commit: a2d2709ec1]
2020-05-22 15:52:35 -04:00
Tao Sang 771f126190 Fix square build failure with static lib in Jenkin
When libamdhip64_static.a is built by Jenkin, sample square cannot been
built successfully because libamdhip64_static.a is archiveved in thin
mode. Thus in the patch it will be archiveved in full mode. Meanwhile
libamdhip64_static_temp.a will be useless and thus removed.

Change-Id: Ifd3882598ef0dc5e7af8db0e389e786025ceb455


[ROCm/hip commit: 470b89a6bf]
2020-05-22 11:49:52 -04:00
Aryan Salmanpour e0b47cf44f Add support for hipExtStreamCreateWithCUMask API
Change-Id: I369d0eaca493821c4badc6b18ac02daa2fddc95f


[ROCm/hip commit: 7dd5b19290]
2020-05-22 11:34:06 -04:00
Matt Arsenault 9156cf7be3 Don't search ROCclr_DIR for prof_protocol.h
This points to the cmake directory where the find module was found,
not a prefix for where it was found.

Based on the search below looking in roctracer, searching in ROCclr
for the header doesn't make much sense. The header should be either
provided by ROCclr xor roctracer. Having it possibly be provided by
two different dependencies is confusing, and a potential source of
version mismatch problems.

Change-Id: Ic2f6ec03f9a7b86225cf7e5c43f39a1360318a34


[ROCm/hip commit: d6aad8ae91]
2020-05-22 09:59:09 -04:00
Laurent Morichetti 02d5a7c4b9 load functions when registered if lazy load is disabled
Change-Id: I08c9684ca4ab86a6294ed9e670f3125c1a0cc6c4


[ROCm/hip commit: 22edde84d5]
2020-05-21 09:19:20 -04:00
Sarbojit Sarkar ca8de0f6c8 added null check
Change-Id: I7631965286bad5684bacb7e38c63031b5c691dc0


[ROCm/hip commit: 87d1101a33]
2020-05-20 23:08:55 -04:00
Saleel Kudchadker 7836dfd322 Fix elapsed time calc for hipEventElapsedTime
If the start and stop events have same command internally
then measure command end to command start
Change-Id: Ie70cfa37c06c06573f0ed58dab2bbe4434c1724b


[ROCm/hip commit: 50be95e169]
2020-05-20 16:02:48 -04:00
agodavar e5c6555eee Fix hipMemset for unaligned ptr, correct offset required by ROCclr per aligment and testcase to validate unaligned ptr
Change-Id: Ib1a0f9d1556d09cf72a12a90cad2e27c6d9c6a1c


[ROCm/hip commit: 458a966aa1]
2020-05-16 02:38:14 -04:00
Matt Arsenault 0becc2185e Include interface directories from rocclr target
This is overly painful because this is an object library.

Change-Id: I618843b810549876053212bf24efff18aece9470


[ROCm/hip commit: f55e253699]
2020-05-15 13:17:13 -04:00
Payam bfea574271 load functions when registered if lazy load is disabled
Change-Id: I6f10a72f7643e476407af03b04ef52e59741be45


[ROCm/hip commit: a5b4f5f02d]
2020-05-15 12:15:32 -04:00
Evgeny 73eb4c6330 API tracing instrumentation
Change-Id: I257409b9fe299b009ded3e3a43287322d5f93a70


[ROCm/hip commit: 5abb8e1a68]
2020-05-14 11:03:09 -05:00
Payam 514b242275 adding support to disable lazy loading, HIP_ENABLE_LAZY_KERNEL_LOADING
Change-Id: Iafe0f396570ee2bccf642b537cbf9aad967e1370


[ROCm/hip commit: 56509b0ffd]
2020-05-13 17:18:48 -04:00
Christophe Paquot 56a91401a4 Make sure to remove the global var from amd::MemObjMap
We need this otherwise ROCr can give us a matching address
for another allocation and doing "insert" in ROCclr will not
update the map with the newest object. We would then end up
using stale objects (yikes)
SWDEV-234992

Change-Id: I3475adf9781a9309d64a024fae45181d7e5afb04


[ROCm/hip commit: a03fee04fe]
2020-05-13 00:26:19 -07:00
Christophe Paquot 2588c88679 Add lock to addFatBinary and removeFatBinary
In case hipModule(Un)Load is called from different thread as hipInit we need to grab the lock
as both are going to modify modules_
Also add some logging for __hipExtractCodeObjectFromFatBinary in case binary isn't found for GPU
SWDEV-236032

Change-Id: Icbd72b412502df80d5066cea42a4fbcd5b0b8a98


[ROCm/hip commit: f100ae3679]
2020-05-12 16:04:08 -07:00
Saleel Kudchadker cd7c57c3ff Merge "SWDEV-235495 Fix elapsed time calculation" into amd-master-next
[ROCm/hip commit: 7f548c5aa9]
2020-05-12 15:23:23 -04:00
Saleel Kudchadker 9aa52425e6 SWDEV-235495 Fix elapsed time calculation
This issue happens because we getLastQueuedCommand when recording
the event and do end_ - start_ so it takes the ticks for the
completion of the last command before event record. This may not
happen if one records a marker command for hipEventRecord

Change-Id: I1d6b06a5befb3b93f16b67692c59dca25c982e0f


[ROCm/hip commit: 43986c6791]
2020-05-12 09:38:01 -07:00
Christophe Paquot 71c2e64024 Merge "HPC : Intermittent hangs are observed while running Gromacs benchmarks" into amd-master-next
[ROCm/hip commit: 538f18f06c]
2020-05-12 11:21:47 -04:00
Karthik Jayaprakash fe7cfd3bfe Merge "SWDEV-227602 - Fixing hipFuncGetAttribute parameters" into amd-master-next
[ROCm/hip commit: 54d264c418]
2020-05-12 10:52:25 -04:00
Matt Arsenault 5d0b99f693 Use find_package to find ROCclr
Maintain compatability with the old finding for now for the
convenience of commit order.

Change-Id: I99b236cbb3d61b00650e3da7fe5931d4c4b3fec6


[ROCm/hip commit: 024764c337]
2020-05-12 09:28:19 -04:00
kjayapra-amd 38587ea539 SWDEV-227602 - Fixing hipFuncGetAttribute parameters
Change-Id: I46bd079372f453cabfaa2c709e2b30c69400dd33


[ROCm/hip commit: 78e27488be]
2020-05-12 09:15:43 -04:00
Matt Arsenault 98787af268 Use project relative include dir for generated header paths
Change-Id: I8c0834d68e6dac00b41a7059a978cbd2ebb933f9


[ROCm/hip commit: ab285297e9]
2020-05-11 21:57:25 -04:00
Christophe Paquot 9bfa6e5c99 HPC : Intermittent hangs are observed while running Gromacs benchmarks
SWDEV-235579
Move the lock before destroying the queue as there's a multithreaded race condition if the queue
is being destroy and right after we set queue_ to nullptr, another thread can call ihipWaitStreams
which will then call create on that same stream because queue is now nullptr.
Moving the lock on streamSet prevents this from happening because we would remove the stream from that
list and therefore ihipWait will not try to call asHostQueue which tries to create the queue if not created yet
since the stream won't be in the list anymore

Change-Id: I3108657ab403d39d4123e83294fcf1f0880e5563


[ROCm/hip commit: 6b361bc1a0]
2020-05-11 16:35:13 -07:00
Payam 565d802d8c updating hipDeviceProps_t-< arch flags according to SWDEV-234277
Change-Id: I6238edf9a2df15a5dfe420dbb8723e10a0725f98


[ROCm/hip commit: a477612a22]
2020-05-11 16:43:13 -04:00
Matt Arsenault 39c4ca378a Start cleaning up rocclr include paths
Use target_include_directories instead of global includes.

Change-Id: I3adadc905843f152a548c71b2f12701476065207


[ROCm/hip commit: 16dbce3776]
2020-05-11 15:24:19 -04:00
Vlad Sytchenko 27da694f1c Correct HIP_FUNC_ATTRIBUTE_NUM_REGS query
Change-Id: I526cc7871c690260df0fa8c1b3b4b15fbc5af219


[ROCm/hip commit: fec51e85b0]
2020-05-09 12:42:30 -04:00
Christophe Paquot 424571c360 Merge "Don't add a null command to waitList in hipMemcpy" into amd-master-next
[ROCm/hip commit: 507f6bb0c3]
2020-05-08 17:01:38 -04:00
Christophe Paquot 201e411e6f Don't add a null command to waitList in hipMemcpy
SWDEV-235345

Change-Id: Ib1abd0ba6414d081891a9f5209df083c45734aee


[ROCm/hip commit: 3ca2d1e6a9]
2020-05-08 12:43:41 -07:00
Vlad Sytchenko 802b60054d Correct HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK query
We should be returning the max workgroup size calculated by the compiler.

Change-Id: If86590efbb9b291f470bdbe87e5df992e661c539


[ROCm/hip commit: 1b1c032e9f]
2020-05-08 14:36:47 -04:00
Vlad Sytchenko 2e98030e46 Fix confusion in hipFuncGetAttribute()
Cuda shared == OpenCL local

Cuda local == OpenCL private

Change-Id: I5a204945ecde35919b9e9def20bbb2662fffea2b


[ROCm/hip commit: a373538d72]
2020-05-08 14:36:36 -04:00
Matt Arsenault d80c0b6cd1 Don't add llvm includes to rocclr build
There are no llvm includes here.

Change-Id: I0567c6e47e717580819f3854782ba08501bd069d


[ROCm/hip commit: 6262ce482f]
2020-05-08 12:24:49 -04:00
Sarbojit Sarkar 5c48d15bbc Enabling hipGetDeviceFlags required in [SWDEV-229170]
Change-Id: I998d37e5847f9651345554bada86df6fce86d1eb


[ROCm/hip commit: 3612851809]
2020-05-08 01:37:23 -04:00
Aaron Enye Shi 995949cb64 Fix missed VDI names in hip-on-rocclr
Change-Id: I830feb37a043656136648e92a0c6f1eaae8402d7


[ROCm/hip commit: 1c1be71b63]
2020-05-07 08:37:28 -04:00
Christophe Paquot 94570bacc2 Merge "SWDEV-232464 - Need to initialize image with ptr passed since they can pass image not of type __ClangOffloadBundler." into amd-master-next
[ROCm/hip commit: 78df96024d]
2020-05-06 16:42:50 -04:00
kjayapra-amd b2ca695e5c SWDEV-232464 - Need to initialize image with ptr passed since they can pass image not of type __ClangOffloadBundler.
Change-Id: I2c50042220a0230bc445ed21728f114a229c53e1


[ROCm/hip commit: 5e91bee221]
2020-05-06 14:25:43 -04:00
Christophe Paquot d6f0c4fc41 Skip iHipWaitActiveStreams if stream is NonBlocking
SWDEV-234484

Change-Id: I279bdc8485d8218e0aaa89d094c08a84f002a608


[ROCm/hip commit: f0b49d0560]
2020-05-06 10:36:53 -07:00
Aakash Sudhanwa 9f0b428aa4 rocclr/CMakeLists.txt: Fixing unresolved merge conflict
Change-Id: I09b9a955b0f1ece8d278112a22bc8aef31b57258
Signed-off-by: Aakash Sudhanwa <Aakash.Sudhanwa@amd.com>


[ROCm/hip commit: 6f86a74018]
2020-05-06 07:24:25 -07:00
Payam 0c8b343931 name change vdi to rocclr
Change-Id: I06d198bbb4a499e153b290b73a92afed3553b252


[ROCm/hip commit: c5f76c3de3]
2020-05-06 09:14:30 -04:00