Commit Graph

964 Commits

Author SHA1 Message Date
Wen-Heng (Jack) Chung cfe930f9d6 Make hipModuleGetGlobal be in HIP runtime so it can be discovered at runtime (#981)
* Make hipModuleGetGlobal be in HIP runtime so it can be discovered at runtime

In HIP PR #929, quite a few HIP public APIs were made as inline functions with
hidden visibility. It was necessary to support applications with shared
libraries with GPU kernels launched via hipLaunchKernelGGL(), after HIP runtime
is initialized.

In empirical tests, the implementation has been proved to be a bit too
excessive, especially for hipModuleGetGlobal(). The function is used by another
type of client applications which relies on the existence of this function
within HIP runtime so global symbols from HSA code objects loaded dynamically
at runtime can be retrieved programmtically.

This commit moves hipModuleGetGlobal() back to src/hip_module.cpp, and makes it
visible and not inline, to fulfill requirements for applications
aforementioned. It does not change the behavior of applications depending on
hipLaunchKernelGGL().

* Add HIP_INIT_API into the implementation of hipModuleGetGlobal

Address review comments.

* Fix failing HIP unit tests


[ROCm/clr commit: 04915cea2f]
2019-03-29 03:45:04 +00:00
Jeff Daily 5233d41c6c improve program state commentary
Disambiguate calling many varibles "agent".
More detail in exception message.
Create and discard map placeholders; no need to call std::vector::clear() on map value.


[ROCm/clr commit: f5e4fff6cc]
2019-03-27 21:40:27 +00:00
Jeff Daily 9cee2c5311 load program state once per agent
[ROCm/clr commit: 2845b4c4b8]
2019-03-27 18:19:10 +00:00
Maneesh Gupta 6fb7f626ba Merge pull request #990 from mhbliao/hliao/master/sw
SWDEV-184380 Fix hcc compilation

[ROCm/clr commit: 178e3ecdca]
2019-03-27 05:23:26 +00:00
Michael LIAO c5717a37d7 SWDEV-184380 Fix hcc compilation
- `hcc` has no builtin. Need to invoke LLVM intrinsic directly.


[ROCm/clr commit: d355122bf9]
2019-03-26 15:20:17 -04:00
Michael LIAO 5482fa8102 [hip] Fix typo in macro hipLaunchKernel
[ROCm/clr commit: 13655df76e]
2019-03-25 12:06:46 -04:00
Maneesh Gupta 817e064745 Merge pull request #970 from mangupta/swdev-172995
hipExtMallocWithFlags implementation

[ROCm/clr commit: c20d233585]
2019-03-25 07:46:53 +00:00
Maneesh Gupta 888b43cc6f Merge pull request #982 from ROCm-Developer-Tools/hack_swdev-173477
HACK for SWDEV-173477

[ROCm/clr commit: 158eac9374]
2019-03-22 09:14:38 +00:00
Wen-Heng (Jack) Chung 86379d694f HACK for SWDEV-173477
For code objects with global symbols of length 0, ROCR runtime would
ignore them even though they exist in the symbol table. Therefore the
result from read_agent_globals() can't be trusted entirely.

As a workaround to tame applications which depend on the existence of
global symbols with length 0, always return hipSuccess here.

This behavior shall be reverted once ROCR runtime has been fixed to
address SWDEV-173477


[ROCm/clr commit: cf7ad0f184]
2019-03-21 17:18:16 +00:00
Nico Trost 0b3f8dce2b fixed loss of accuracy in hipCfma()
[ROCm/clr commit: 725486fb11]
2019-03-21 10:30:10 +01:00
Maneesh Gupta 19bba906a2 Merge pull request #972 from yxsamliu/global
Add declaration of symbol related API for VDI

[ROCm/clr commit: ce72890dcf]
2019-03-20 05:12:21 +00:00
Maneesh Gupta aac0de849c Merge pull request #973 from mhbliao/hliao/master/build
[Device Function] Fix typos.

[ROCm/clr commit: 54091b5273]
2019-03-20 05:12:14 +00:00
eshcherb 05b9ae6a09 adding prof primitives generator (#967)
* adding prof primitives generator

* minor change, renaming

* minor cosmetic changes, comments correcting and dead code removing

* minor changes and renaming

* minor chane, fixing comments


[ROCm/clr commit: 1229750546]
2019-03-20 05:11:40 +00:00
Siu Chi Chan 597c06b6be reimplement HIP_INIT as hip_impl::hip_init(), add hip_init() to some of the inlined API (#966)
* reimplement HIP_INIT as a function, expose it as hip_impl::hip_init()
so that it could be called from hipLaunchKernelGGL and other inlined
HIP functions

* Don't call hip_init from ihipPreLaunchKernel


[ROCm/clr commit: fa9495841b]
2019-03-20 05:11:15 +00:00
Michael LIAO 43afb85ca4 [Device Function] Fix typos.
[ROCm/clr commit: f42e84cef7]
2019-03-19 15:32:19 -04:00
Yaxun Sam Liu 24bd42fb57 Add declaration of symbol related API for VDI
[ROCm/clr commit: fb3241a000]
2019-03-19 11:11:49 -04:00
Maneesh Gupta 4366c618d5 Merge pull request #965 from mhbliao/hliao/master/immarg
[Device Function] Support immediate argument.

[ROCm/clr commit: e7453483e2]
2019-03-19 18:41:31 +05:30
Maneesh Gupta 64089c1d87 Merge pull request #954 from mhbliao/master
[hip] Re-implement hipLaunchKernelGGL as macros.

[ROCm/clr commit: 1500eec5f7]
2019-03-19 18:39:27 +05:30
Maneesh Gupta f1d064562d hipExtMallocWithFlags implementation
Change-Id: Iee9e119796472200b2933d5e23be60813f33bc75


[ROCm/clr commit: e44de376f7]
2019-03-19 11:59:22 +05:30
Michael LIAO 360e5b366d [Device Function] Support immediate argument.
- `immarg`, immediate argument, is enabled on all AMDGPU intrinsics.
  Revise device functions using these intrinsics with immediate
  arguments.


[ROCm/clr commit: b74b4500c4]
2019-03-15 12:38:04 -04:00
Evgeny a0c8ef2e96 tracing callback layer update
[ROCm/clr commit: 2aa88a4505]
2019-03-14 22:43:52 -05:00
Maneesh Gupta fc835d6a43 Merge pull request #958 from aaronenyeshi/cxxabi-mismatch-workaround
CXX11 ABI Mismatch Workaround

[ROCm/clr commit: 23170f6af8]
2019-03-15 06:15:46 +05:30
Siu Chi Chan b2a51c6cdb remove visibility hidden attribute
[ROCm/clr commit: 739d43c5d8]
2019-03-13 11:58:32 -04:00
Evgeny 0b4f2151a2 adding memset32d
[ROCm/clr commit: 0586924ae6]
2019-03-11 21:28:27 -05:00
Siu Chi Chan 2d6ebcaffb minor cleanup
[ROCm/clr commit: 5044c9ba49]
2019-03-11 19:51:57 +00:00
Siu Chi Chan 7955348b8e remove old style triple name
[ROCm/clr commit: f54da9358b]
2019-03-11 19:51:51 +00:00
Siu Chi Chan f7817c48d5 move triple_to_hsa_isa into the header
[ROCm/clr commit: 30053f6443]
2019-03-11 19:51:44 +00:00
Siu Chi Chan 3951fccb4e Fix memory leak introduced by previous change to Agent_global.
Make Agent_global manage the lifetime of the name string


[ROCm/clr commit: fa564a5345]
2019-03-11 19:51:32 +00:00
Aaron Enye Shi 3562ddf981 Fix Agent_global variables failing hipTestDeviceSymbol
Issue: Header uses std::vector<Agent_global> agent_globals which is created by hip_module.cpp
  - Move iterator fails to copy Agent_global from library source into header version
  - Due to different versions of std::string name in struct Agent_global
Fix: Change Agent_global to use char* name instead of std::string name


[ROCm/clr commit: fcde9fe3df]
2019-03-11 19:51:25 +00:00
Aaron Enye Shi 4326d67550 Fix hash_for undefined reference in hipTestConstant test
Issue: mismatch undefined symbols in different user env
  - Binary expects modified return value std::string&
  - Fails to match libhip_hcc.so: return value is std::string& but doesn't match modified C++ env
Fix: Change return value to char*, create new key std::string in header from char*


[ROCm/clr commit: f8aca3159c]
2019-03-11 19:51:18 +00:00
Michael Liao f2229f31b4 [hip] Re-implement hipLaunchKernelGGL as macros.
[ROCm/clr commit: f46d6cf249]
2019-03-08 09:10:51 -05:00
Maneesh Gupta 35ebb36cbd Merge pull request #951 from tycho/nvcc-hipDeviceSetCacheConfig
nvcc_detail/hip_runtime_api.h: add missing hipDeviceSetCacheConfig API

[ROCm/clr commit: 44309ee879]
2019-03-08 09:22:25 +05:30
Yaxun Sam Liu d1721cc124 Fix HIP/VDI build failure due to dlopen change
[ROCm/clr commit: 2dc87b6019]
2019-03-07 14:45:45 -05:00
Steven Noonan 9f642e40ad nvcc_detail/hip_runtime_api.h: add missing hipDeviceSetCacheConfig API
Signed-off-by: Steven Noonan <steven@uplinklabs.net>


[ROCm/clr commit: 27d6755552]
2019-03-06 11:21:36 -08:00
Maneesh Gupta 2a11a5529e Merge pull request #949 from gargrahul/single_stream_concurrent_kernels
Add extension for kernel concurrency on same stream

[ROCm/clr commit: 3955f2c131]
2019-03-06 17:34:54 +05:30
Alex Voicu 45f4ac5023 dlopen() fixes (#929)
* Initial attempt to switch over to internally linked state.

* Add missing CMake update.

* hipLaunchKernelGGLImpl must be inline as well. Ensure internal linkage.

* Ensure global retrieval uses internally linked state.

* Hide HC in the implementation. Minimise ADL woes.

* Strange software exists, and must be catered to.

* Use a less spammy mechanism for ensuring internal linkage / non-export.

* Remove leftover internal detail.


[ROCm/clr commit: ed48847237]
2019-03-06 17:31:44 +05:30
Rahul Garg f364b32e29 Add extension for kernel concurrency on same stream
[ROCm/clr commit: 263e82a67a]
2019-03-06 12:55:39 +05:30
Maneesh Gupta 34554f5730 Update hip_runtime_api.h
Use hipCUResultTohipError instead of hipCUDAErrorTohipError in hipMemsetD32 & hipMemsetD32Async.

[ROCm/clr commit: 38b7a43b43]
2019-03-05 12:10:01 +05:30
Wen-Heng (Jack) Chung e34b0ccd48 Address code review comments to use hipDeviceptr_t
[ROCm/clr commit: 8b7baa0bd9]
2019-03-05 05:51:05 +00:00
Wen-Heng (Jack) Chung a4b654a5af Add implementation for NVCC path
[ROCm/clr commit: b46e684d2e]
2019-03-04 20:11:12 -08:00
Wen-Heng (Jack) Chung 2706bf46f2 Add hipMemsetD32 and hipMemsetD32Async
Add 2 extra memset functions which fills memory with integer-typed data

Also change the parameters of ihipMemset to better explain the semantic


[ROCm/clr commit: 392271f4db]
2019-03-04 17:00:33 +00:00
Maneesh Gupta 7627e3dfe9 Merge pull request #937 from yxsamliu/nan2
Fix nan for windows

[ROCm/clr commit: c1ff2c95a4]
2019-02-28 07:14:27 +05:30
Yaxun Sam Liu 0b8586ab26 Fix nan for windows
[ROCm/clr commit: 0ebe23512f]
2019-02-27 12:33:26 -05:00
Rahul Garg 1c95abbb18 Fix forceinline for non HCC compilation
[ROCm/clr commit: 832142234b]
2019-02-26 07:50:09 +05:30
Maneesh Gupta c7cd92aacb Fix signature for unsigned long long variant of atomicExch
This fixes #888

Change-Id: I2b2dc5ed1ff2a26083ad9d102eccac90f67801ae


[ROCm/clr commit: fdbf84558c]
2019-02-13 09:45:07 +05:30
Maneesh Gupta 2cc84d5421 Merge pull request #913 from aaronenyeshi/fix-texture-constant-addrspace
Fix texture using constant addrspace 4

[ROCm/clr commit: f1f9cc0d55]
2019-02-13 08:59:01 +05:30
Maneesh Gupta 42a389aa1b Merge pull request #912 from ROCm-Developer-Tools/remove-cpp-function-templates-for-malloc
Remove C++ function templates for hipMalloc and hipHostMalloc

[ROCm/clr commit: 61d9553103]
2019-02-13 08:58:26 +05:30
Aaron Enye Shi 132338e55b Fix texture using constant addrspace 4
[ROCm/clr commit: eec46be762]
2019-02-12 16:56:22 +00:00
Wen-Heng (Jack) Chung 26e7f98be3 Introduce __HIP_DISABLE_CPP_FUNCTIONS__ macro to disable C++ wrappers
hipMalloc and hipHostMalloc are C++ function templates by default. In some
applications they need to discover the decltype of underlying C functions. In
this commit, a new macro __HIP_DISABLE_CPP_FUNCTIONS__ is introduced to
suppress the C++ function templates.

Existing HIP applications don't need to be changed. hipMalloc and hipHostMalloc
will behave just the same.

For new applications which depends on identifying decltypes of underlying C
functions, __HIP_DISABLE_CPP_FUNCTIONS__ shall be defined prior to including
HIP headers.


[ROCm/clr commit: f4e1f74e9e]
2019-02-11 09:33:15 -06:00
Maneesh Gupta d04c8f587b Merge pull request #907 from yxsamliu/nan
Fix nan() for windows

[ROCm/clr commit: 3112c52742]
2019-02-11 11:24:12 +05:30