Граф коммитов

246 Коммитов

Автор SHA1 Сообщение Дата
Rahul Garg 19c84bc604 ROCMOPS-1956 - Push restructured code to hipamd
hipamd will have AMD's ROCCLR based HIP backend implementation

Change-Id: Id7de9634519b4ce46fca71a1b61f3d5b1e3fc459
2021-06-07 21:42:44 +00:00
Tao Sang 1cba7ec965 Remove hip-hcc codes: Part one
Remove hip-hcc codes from hip code base
Simplify hip CMakeLists.txt to exclude hip-hcc
Simplify cmake cmd for hip-rocclr building
Some minor fixes

Change-Id: I1ae357ecfd638d6c25bca293c1724b026be21ecd
2020-12-09 15:49:47 -05:00
Yaxun (Sam) Liu d556c3425b Disable device side malloc (#2009)
* Disable device side malloc

Currently device side malloc is not working and takes excessive
device memory.

Disable it for now until a working malloc is implemented.

Change-Id: I1ad908c1c53a83752383b4be96688a848642c699
2020-04-14 16:07:14 +05:30
Aryan Salmanpour 4d05b4dce7 [HIP] add support for NoPreSync/NoPostSync flags for Cooperative MultiDevice launch API (#1990) 2020-04-13 14:02:52 +05:30
satyanveshd 20d9986548 fix hipIpcOpenMemHandle (#1998) 2020-04-06 15:39:49 +05:30
Rahul Garg 017a27214c Fix 2D and 3D memset (#1987) 2020-04-06 15:35:59 +05:30
Sarbojit2019 b55775a49e Fix for segfault seen in hipMemcpyDtoD (#1964)
* Fixes SWDEV-227444.
2020-03-28 17:29:49 +05:30
satyanveshd 4554bbd9f9 [dtests] Added few Negative tests (#1735) 2020-03-27 14:10:12 +05:30
Sarbojit2019 12448996e3 Fix for segfault seen if invalid kind is passed to hipMemcpy (#1937)
Fixes SWDEV-224941
2020-03-26 17:04:43 +05:30
srinivamd 32960ab8f9 return hipSuccess when count is zero (#1900) 2020-03-11 14:32:54 +05:30
Alex Voicu cea5489f00 Address post-staging issues in #1809 (#1894)
Fixes SWDEV-223910 and SWDEV-223663
2020-02-27 16:21:12 +05:30
Alex Voicu 730f23829e Tweak synchronous memcpy implementation (#1809)
The existing one can have issues on certain systems, therefore this limits use of direct memcpy via largeBAR to sizes where it is unequivocally better.

Also addresses SWDEV-220030 and SWDEV-222237.
2020-02-18 20:50:27 +05:30
Rahul Garg ec84c16d75 Fix hipMemcpy3D (#1798)
Fixes #1790 and #1791. hipMemcpy3D still requires further refactoring for different input and output combinations.
2020-02-17 19:35:35 +05:30
ansurya 688b6e6af0 Fix texture tests, always pass row pitch to HSA API for linear layout images (#1785)
=> New ROCr calculates pitch as per HSA specification and addrlib is used to check whether HW can support that configuration. Hence few texture tests are failing with HSA_EXT_STATUS_ERROR_IMAGE_PITCH_UNSUPPORTED.

=> Determine pitch for linear images and always pass rowpitch to HSA API's.
2020-01-16 08:54:30 +05:30
satyanveshd 9b2f22f7aa hipMemcpy[To/From]Symbol(Async) fixes (#1774) 2020-01-07 08:11:53 +05:30
Rahul Garg 178d432b90 Fix nested designator warnings (#1768) 2020-01-06 12:33:34 +05:30
Evgeny Mankov ed43699a3a Merge pull request #1759 from emankov/master
[HIP] Unify hipError_t (Step 2)
2019-12-30 19:21:09 +03:00
ansurya 651c7a8e27 Fix texture 3D & 2D layered with N components (#1746)
SWDEV-151670: Issue with 3D texture with 4 components
SWDEV-151671: Issue with 2D layered texture with 4 components

Fixed memcpy when memory is allocated with driver API's.

Github issues: #1755
Fixed 3D default case when array type is not set during memory allocation.
2019-12-30 12:41:42 +05:30
Evgeny Mankov 4aaa2336a8 [HIP] Clean-up deprecated HIP error codes
hipErrorMemoryAllocation -> hipErrorOutOfMemory
hipErrorInitializationError -> hipErrorNotInitialized
hipErrorMapBufferObjectFailed -> hipErrorMapFailed
hipErrorInvalidResourceHandle -> hipErrorInvalidHandle
2019-12-23 17:01:35 +03:00
Alex Voicu 150e690a3a Fix late-coming issues. (#1724)
Implementation for hipMemcpyWithStream.
2019-12-23 19:11:24 +05:30
Rahul Garg a369bd4418 Revert - Changes related to hipMemcpyWithStream (#1718)
Reverting #1673, #1697 and #1707.
Support for hipMemcpyWithStream and memcpy optimizations, will be brought in again once issues seen with these are resolved independently.
2019-12-06 09:51:53 +05:30
Rahul Garg 261a04580f Fix hipMemcpyWithStream (#1707)
* Fix hipMemcpyWithStream
* Add a dtest for the same.
2019-12-04 11:56:23 +05:30
Jeff Daily 6df73e1f12 fix hipMempcy precondition, test for zero size first (#1697) 2019-11-25 19:03:03 -08:00
Alex Voicu 022ac3cb0a General sync memcpy improvements. Add hipMemcpyWithStream (#1673)
* General sync memcpy improvements. Add `hipMemcpyWithStream`

* Update hip_memory.cpp
2019-11-20 21:36:37 +05:30
Jeff Daily 854147e911 General hipMemset improvements (#1495)
* hipMemset et al can use HSA API directly for synchronous cases

* lock and flush stream in hipMemset, hold lock until complete

* move hipMemset async check to front of conditional

* use hsa_amd_memory_fill for additional sync memset cases

code cleanup/review for all memset calls

* Fix inversion of execution mutating value.

* ihipMemsetSync fall back to kernel if HSA memset fails

* Never fallback, never surrender.

* Allow NULL stream.

* Optimise memset kernel. Remove deadwood.

* Update hip_memory.cpp

* Clean up stream logic in sync memset

* Revert "Clean up stream logic in sync memset"

This reverts commit 6117dedf673367f44cc704192573a117a3d92477.
2019-11-07 13:19:54 +05:30
ansurya dc8f556460 Fixed texture 2D mapping for pitched arrays & 3D Texture read (#1415)
Texture 2D image mapping for pitched arrays:
github issue: Texture Object's Buffer seems to be Misaligned #886
JIRA ticket: SWDEV-199313

SWDEV-151670 : Fixed issue with 3D texture with 4 components
SWDEV-151671 : Issue with 2D layered texture with 4 components
2019-11-07 13:17:46 +05:30
Rahul Garg f556e15361 Add stream 2019-10-31 12:15:56 -04:00
Rahul Garg 0718ba0f00 Fix HIP init calls in hipMemcpy2DFromArray 2019-10-31 12:15:56 -04:00
Rahul Garg 14b870d1ce Add hipMemcpy2DfromArray (#1510)
Adds hipMemcpy2DFromArray and hipMemcpy2DFromArrayAsync equivalent to cudaMemcpy2DFromArray and cudaMemcpy2DFromArrayAsync.
2019-10-25 15:43:33 +05:30
Aryan Salmanpour 93c688a0c9 [hip] add support for implicit kernel argument for multi-grid sync (#1456)
* [hip] add support for implicit kernel argument for multi-grid sync

* modified code for calculating the prev_sum

* change the impCoopArg type to size_t

* add memory clean up

* launch init_gws and main kernels into two separate loops
2019-10-24 17:43:30 +05:30
Vladislav Sytchenko 0200aa3a21 Update the declarations of hipMemsetD8, hipMemsetD8Async, hipMemsetD16, hipMemsetD16Async. These functions are type aware and take in as their third argument the number of elements in the buffer, not the buffer size. Change the name of this argument from sizeBytes to count to align with the above description. 2019-10-15 14:18:42 -04:00
ansurya 96890792b0 Added new Memory API's (#1399)
Added new memory API's hipMemAllocPitch, hipMemAllocHost, hipMemsetD16, hipMemsetD16Async, hipMemsetD8Async
Modified to support all scenarios hipMemcpyParam2DAsync, hipMemcpyParam2D.
2019-10-04 13:36:31 +05:30
satyanveshd 1ae4cbed4d Reimplement hipMemGetInfo (#1447)
Addresses SWDEV-136570. hipMemGetInfo changed to compute free memory based on information from kfd instead of relying on hc::am_tracker.
2019-10-01 12:40:36 +05:30
satyanveshd 842e304a9c Fix checks in hipMemcpy[D/H]to[D/H]() (#1397)
* SWDEV-202043 hipMemcpyDtoD() issue
2019-09-16 08:32:38 +00:00
Rahul Garg d9179cbe70 Fix typo and colon in comment 2019-09-13 03:09:01 +05:30
Rahul Garg 2e9b8e9d0d [HACK] Temporary fix for hipFree for hipManagedMalloc 2019-09-13 02:10:21 +05:30
Rahul Garg d433f6fb58 Revert "Using HSA API for hipMemsetAsync (#1346)" (#1381)
This reverts commit 9bbd09b04f.
2019-09-03 05:13:46 +00:00
Rahul Garg a786728939 Fix memcpy with IPC slowness (#1321)
* Fix memcpy with IPC slowness

* Make early erroneous returns

* Real Clean up

* Real Clean up++
2019-08-23 09:19:18 +00:00
Jatin Chaudhary 9bbd09b04f Using HSA API for hipMemsetAsync (#1346) 2019-08-21 10:00:10 +00:00
Rahul Garg fbc9f7e20a Add hipMemcpy3DAsync (#1320)
* Add hipMemcpy3DAsync

* Fix CI build error

* Move back stream resolution to internal function

* Remove stream redefinition and check
2019-08-16 02:13:16 +00:00
Rahul Garg 569f35a258 Add hipMemcpyParam2DAsync (#1296)
* Add hipMemcpyParam2DAsync

* Add NVCC path changes

* Clean up

* Fix build issue

* Fix else use in both sync and async apis
2019-08-09 11:50:37 +00:00
Jeff Daily f337ae1edb consolidate thread local storage (#915)
* all thread local access now through single struct

* clean up old commented-out code, more use of GET_TLS()

* fewer calls to GET_TLS by passing tls as a funtion argument

* revert unnecessary change to printf

* fix failing tests due to TLS change

* fix merge conflicts in ihipOccupancyMaxActiveBlocksPerMultiprocessor
2019-08-05 09:51:02 +00:00
Rahul Garg 1c49943ac3 Change hipErrorUnknown to hipErrorInvalidValue 2019-07-31 00:28:30 +05:30
Evgeny Mankov 299fbd4842 [HIP] Fix segfault on uninitialized struct members in hipArrayCreate and hipArray3DCreate 2019-07-12 16:38:26 +03:00
Evgeny Mankov f0832fd968 [HIP][HIPIFY] Split HIP_ARRAY_DESCRIPTOR struct to HIP_ARRAY_DESCRIPTOR and HIP_ARRAY3D_DESCRIPTOR
[Reason] To be compatible with CUDA [#1133]

Update HIP code, hipify-clang, tests and docs

[TODO] Add support of the corresponding functions on nvcc fallback path
2019-07-11 14:58:16 +03:00
Jatin Chaudhary fcb0a3d4e2 Adding bounds check before hipMemset (#1190)
* Adding bounds check in ihipMemset

* Adding ihipMemPtrGetInfo to hipMemPtrGetInfo
2019-07-08 11:00:38 +00:00
Anusha Godavarthy Surya 4989452413 Added missing NULL checks and corrected API return values as per validation 2019-06-27 00:19:05 +05:30
Evgeny Mankov 9cb3e9aa5e [HIP][HIPIFY] Make hipMemcpyParam2D coherent with cuMemcpy2D
+ Makes hip_Memcpy2D struct compatible with CUDA_MEMCPY2D struct
+ Add hipMemcpyParam2D support in nvcc fallback path
+ Update hipify-clang, tests and docs accordingly
2019-05-22 18:31:39 +03:00
Rahul Garg e1f3dc0c80 Add fine grained host memory lock support (#1095)
* Add fine grained host memory lock support

* Fix default flag check
2019-05-13 11:48:26 +05:30
Rahul Garg 94769fc8dd Add hipMallocManaged default functional support (#1036)
* Add hipMallocManaged default functional support

* Fix build error

* Add dtest
2019-04-24 16:50:03 +05:30