Commit Graph

48 Commits

Author SHA1 Message Date
sunway513 1897ca4a20 Refactor events and add initial event option for hipHccModuleLaunchKernel
- Change hipEvent_t to a class.
- Move event logic inside the class.
- Add _type to support Independent, StartCommand, StopCommand events.
  StartCommand returns start timestamp from events.

Change-Id: I4ddd694f2645a3ff7170c9111dc1d3e39931ca21


[ROCm/clr commit: f442e975c6]
2017-04-06 21:02:50 -05:00
Aditya Atluri 28c8d15412 added debug support for HIP sample
Change-Id: Ia7265234082039b68114f7421f4dbcb7149d4d2b


[ROCm/clr commit: 81d3725a16]
2017-03-31 14:13:46 -05:00
Aditya Atluri 3651cb672a added new api hipHccModuleLaunchKernel
1. hipHccModuleLaunchKernel is same as hipModuleLaunchKernel with OpenCL workitem model
2. Added copy right
3. Fixed header naming

Change-Id: I6a7c35a3566e2f8d3f5056613e34193775d4b236


[ROCm/clr commit: 1cead6a4cd]
2017-03-31 12:11:34 -05:00
Aditya Atluri bdaf6a3aaa disabled metadata apis
Change-Id: Ifb8839c581644cccc2afcd18c38a866f649a4144


[ROCm/clr commit: 4e5861df7a]
2017-03-28 10:46:31 -05:00
Aditya Atluri c3f1a37c28 Re-enabled metadata parsing in HIP
Change-Id: If8caa844571cb8581450df9ffdb76e2445c75f13


[ROCm/clr commit: abf369049b]
2017-03-27 11:00:39 -05:00
Aditya Atluri 478eb4e350 removed llvm dependency and metadata functionality
Change-Id: Ib9783b75d326559ed29c5aa2218aed40d20ad0fb


[ROCm/clr commit: 5a0685c137]
2017-03-23 10:16:37 -05:00
Aditya Atluri b4b87b8786 Added default module launch api functionality
1. As in hipModuleLaunchKernel(..., kernelParams, nullptr); works with this commit
    2. Added headers AMDGPUPTNote.h, AMDGPURuntimeMetadata.h to do code object meta data parsing
    3. Changed CMake to look at llvm link libraries
    4. HIP developer should set env variable LLVM_HOME to remove link errors
    5. HIP depends on installed LLVM (not source, not build)
    6. Added sample to test out the feature
    7. Right now HCC does not support embedding metadata in code object. Use clang opencl
    8. Changed HIPCC to read LLVM_HOME env var
    9. New argument to CMake should be given -DLLVM_HOME=<where llvm 5.0 is installed>

Change-Id: Iba38194aa872d97cc2c90a8e5ff746c48055c868


[ROCm/clr commit: 9645b0e0dc]
2017-03-17 13:11:34 -05:00
Ben Sander 0710dbde55 Fix bug in hipModuleGetFunction.
Modules with > 1 function didn't return the function correctly.
Also fix coding convention issues


[ROCm/clr commit: 09df0977c0]
2017-03-08 13:52:38 -06:00
Aditya Atluri 25210492b0 v3: added free for ihipModuleSymbol_t structures inside tracker
Change-Id: Ib8041a05312c08cbdf2d4fee5e7cbae17df6efff


[ROCm/clr commit: 1cffe49775]
2017-02-10 13:42:10 -06:00
Aditya Atluri 3577c19d66 v2: Fixed hipModule memory management
1. Changed test to assert for same hipFunction values
2. Added better memory management for hipModule

Change-Id: I10d7aef13c215a2211e262f3c79017f26a17d9a7


[ROCm/clr commit: 554fe191e1]
2017-02-10 13:32:13 -06:00
Aditya Atluri 6c76483ac8 fixed hipFunction memory management
Change-Id: I7ebb323419bcd220ebd6466a8eb38e7bfdb1520a


[ROCm/clr commit: 6110fcdfb6]
2017-02-09 17:22:55 -06:00
Ben Sander ad2ba66ce6 Read HCC_OPT_FLUSH and optimize dispatch accordingly.
If HCC is in this mode, we can use less aggressive flushes in some
cases.


[ROCm/clr commit: 2f7a8ec39c]
2017-01-25 21:50:52 -06:00
Ben Sander 2ea139e30f Show dynamic shared mem usage not static.
[ROCm/clr commit: 27447f10c2]
2017-01-23 22:34:41 -06:00
Ben Sander 3bc2e3ba02 Fix debug display for Module launch kernels
[ROCm/clr commit: 2ffc9f4e22]
2017-01-19 12:40:45 -06:00
Aditya Atluri a86633f210 changed copyright year from 2016 to 2017 in src directory
Change-Id: Idb97db509b2b4b1656b2df7a14a62ade38c9d574


[ROCm/clr commit: e9ff23e5f9]
2017-01-11 18:05:41 -06:00
Ben Sander 8ab567e331 Add name for function
[ROCm/clr commit: 5d815937de]
2016-12-17 08:54:09 -06:00
Ben Sander c59c82916a Remove HSA dependency from hipFunction_t
Place _groupSegmentSize and _privateSegmentSize inside Function,
remove hsa_executable_symbol_t.


[ROCm/clr commit: 2bd70ff345]
2016-12-17 07:22:56 -06:00
Ben Sander a3064807b5 Remove USE_DISPATCH_HSA_KERNEL=0 path.
[ROCm/clr commit: 06d382bc6d]
2016-12-17 07:22:56 -06:00
Ben Sander 68d861e8c5 Refactor Module and Function APIs.
- hipFunction_t is now returned by value.  This eliminates dynamic
      allocation / memory management complexity in the module.  Removed
the kernel
      name so the structure is just 16 bytes now.

    - Moved the hsa_executable_load_module and hsa_executable_freeze
      calls to the hipModuleLoad and hipModuleLoadData calls.

    - Apply sharedMemBytes in hipModuleLaunchKernel to group segment
      size (not private).


[ROCm/clr commit: 3f9404d0e1]
2016-12-17 07:22:33 -06:00
Ben Sander 448c6b3119 Enabled USE_DISPATCH_HSA_KERNEL, with serialization in hipModuleUnload.
[ROCm/clr commit: 3f810a203b]
2016-12-06 10:14:01 -06:00
pensun 70f0a2f43b HIP resource leaks fix from Jack
Change-Id: I93f3ad7cb94ff1cba1577bd8acc90e826693d12e


[ROCm/clr commit: 4cb1579d4a]
2016-12-05 20:21:33 -06:00
Maneesh Gupta 136d220c10 Revert "Enable USE_DISPATCH_HSA_KERNEL."
This reverts commit bbd9d98af7.


[ROCm/clr commit: ac93376c26]
2016-12-05 16:55:26 +05:30
Ben Sander bbd9d98af7 Enable USE_DISPATCH_HSA_KERNEL.
Optimize hipLaunchModule dispatch latency.


[ROCm/clr commit: f8bcbe8680]
2016-12-04 00:13:19 -06:00
Ben Sander bccb897f84 Add additional controls for forcing serialization and blocking.
Move HIP_COHERENT_HOST_ALLOC so it is read once at init time.
Add HIP_LAUNCH_BLOCKING_KERNELS, HIP_API_BLOCKING.
Update docs on debug and chicken bits.

Conflicts:
	src/hip_hcc.cpp


[ROCm/clr commit: 783ac156ce]
2016-12-02 18:03:59 -06:00
Ben Sander d6ffcdb9b0 Move some internal headers from "include/hip/" to src.
Change-Id: I7041bd5c803d9318979f4a7c1d658445c614691e


[ROCm/clr commit: 403cdf93c3]
2016-10-18 22:27:16 -05:00
Maneesh Gupta 2655c96ab9 src/*: Update copyright header
Change-Id: I455f5d0d12fe9cb39a3ba873bd22b4c25ed07cbf


[ROCm/clr commit: 88d6cad3fb]
2016-10-15 22:55:22 +05:30
Ben Sander 57adbf2a17 Add code to use new HCC API accelerator_view::dispatch_hsa_kernel.
Disabed by default, can enable with USE_DISPATCH_HSA_KERNEL=1

Change-Id: I7a6ba76f2bada34952ed47f5335ce695fa2faea5


[ROCm/clr commit: dcadaadb24]
2016-10-14 23:46:29 -05:00
Ben Sander eea909d96f fix file-not-found detection
Change-Id: Ida84923ed18b3ebf8ffcfd6ee84d8a72f611ecd3


[ROCm/clr commit: 1de3c1e450]
2016-10-13 11:43:49 -05:00
Maneesh Gupta 46feb7dcf2 Move include/* to include/hip/*
Change-Id: I7a7b2839b4df59c7a4c503550f99fdc9e45c0f54


[ROCm/clr commit: bbfc08f419]
2016-10-04 22:17:18 +05:30
Ben Sander 70a3ad883c Adapt to _kernelSymbol
Change-Id: Idebb7d7e895286ce5423afdcf391e00fa8b2b94f


[ROCm/clr commit: 8022671a5e]
2016-09-07 15:48:40 -05:00
Ben Sander c5f7fd723a refactor ihipPreLaunchKernel phase#1
- Fix calls to HIP_INIT_API to pass all function arguments.
- Change ihipFunction to follow coding convention:
    - leading underscore for member fields,
    - camelCase for member fields.
- move kernel print function inside ihipPreLaunchKernel.
- add HIP_TRACE_API_COLOR, control color of messages.
- add ihipLogStatus wrapper to hipDeviceSynchronize()

Change-Id: I20bbb644da213f821404648945197254e3648fc9


[ROCm/clr commit: 745310399d]
2016-09-07 15:18:34 -05:00
Aditya Atluri a4934a7c66 Fixed group and private memory size to AQL
Change-Id: I6e721f63fe5697b7b90a7d25add9aa024d9dc429


[ROCm/clr commit: 26215c515d]
2016-09-07 12:57:18 -05:00
Ben Sander f3da27cd5a Fix double-lock of stream on hipModuleLaunchKernel
Change-Id: I4ca164971c25f4eb8fbcca11d6258367bb3d2ab4


[ROCm/clr commit: 0fdb5bf517]
2016-09-02 12:47:49 -05:00
Aditya Atluri 1e6aa52868 added logger for return status
Change-Id: Ib93012a15b1cfa90714a6ebd5153cc40e28e6566


[ROCm/clr commit: 3fbe062008]
2016-09-02 09:44:00 -05:00
Aditya Atluri 40d824337e fixed code according to convention
Change-Id: Ib90c84a30ea6da3531e8b7c3e281dd4b31915198


[ROCm/clr commit: af86d28187]
2016-09-02 09:31:37 -05:00
Aditya Atluri 41a363a6b7 Changed module api to work with nvcc and hipcc path
- Added cuda and cudart linking for nvcc path in hipcc
- Added hipMemcpyHtoD and hipMemcpyDtoH for nvcc path
- Changed hipDeviceptr to hipDeviceptr_t
- Fixed hipMemcpy*to* API signatues

Change-Id: I6ef076b507f92502efda475c83dcdcdd462afc37


[ROCm/clr commit: fb0c432095]
2016-08-29 15:05:12 -05:00
Aditya Atluri 9fe6924154 Cleaned up module api
- Moved HIP_INIT_API from internal to all public apis
- renamed hipLaunchModuleKernel to hipModuleLaunchKernel
- Changed tests according to the changed api

Change-Id: I822ff63c7c5b7dad340ece49456baf9d89428e9f


[ROCm/clr commit: 71991ed8f8]
2016-08-28 16:48:57 -05:00
Ben Sander 713eb5636d Remove cutnpaste check on uninitialized hsa status
Change-Id: Icc0256b9b1bd01d45cca4feb1106cfe7427bcd15


[ROCm/clr commit: 46c3ff52a6]
2016-08-28 16:35:27 -05:00
Aditya Atluri 33a38a0e26 Added NVCC support and name changes
- Added NVCC support for module APIs
- Changed hipFunction and hipModule data types to hipFunction_t and hipModule_t
- Created new intenal ihipModuleGetFunction as it is used twice
- Changed test to match with the new data types

Change-Id: I300a1c7fd40ed7065b1b8b9de97e3a06b96ed729


[ROCm/clr commit: 74a8fb132d]
2016-08-26 10:32:01 -05:00
Aditya Atluri d769b71efc Added hipModuleGetGlobal and hipModuleLoadData
Change-Id: Iaec873f7d86b72911b6ad32e067a4dfe3d552fe6


[ROCm/clr commit: f22a3189a3]
2016-08-25 14:16:53 -05:00
Aditya Atluri 069d132f41 changed internal structure of hipFunction and hipModule
Change-Id: Ifa343782e29d7e056efc47e56253311013005093


[ROCm/clr commit: af4dc556eb]
2016-08-24 09:47:11 -05:00
Aditya Atluri 9c36b77d39 Module test correction and hipModuleUnload API
- Corrected the hipModule.cpp test to minimal code
- Added hipModuleUnload API
- Added hipModuleUnload API test

Change-Id: I9c40337043d7972a570b795e1bfc104bd2c4d8aa


[ROCm/clr commit: 768287f2a2]
2016-08-23 14:19:15 -05:00
Aditya Atluri 52305186ef Added stream synchronisation for hipLaunchModuleKernel
- The module kernel launch is now in sync with commands in its stream
- Moved launch kernel inside ihipStream

Change-Id: Ic00cfcf4882bf81b6203c36881a52575ea68b529


[ROCm/clr commit: c0fbe7891c]
2016-08-22 14:17:55 -05:00
Aditya Atluri 9571f355ac Added support for executable and symbols for data structures
- symbol handle is added to hipFunction
- executable handle is added to hipModule
- This way, the APIs doesn't need to track the values

Change-Id: I7cf05329cf79fe946319d7746bd9f5503268fda4


[ROCm/clr commit: 9eaabb507c]
2016-08-19 08:49:34 -05:00
Aditya Atluri a0740e524c Added hipLaunchModuleKernel and new error codes
- hipLaunchModuleKernel maps to cuLaunchKernel
- Whole lot of new error codes added for the use of driver api
 - KernelParams arguments is not yet supported
 - hipLaunchModuleKernel is a synchronous api (will change eventually)
 - All the commands in a stream will wait on host when hipLaunchModuleKernel is called on it

Change-Id: Ib4a4fae1db06fbb3a81d5a5575b026aa821264ed


[ROCm/clr commit: 792811fd52]
2016-08-18 11:26:55 -05:00
Aditya Atluri 8747679e06 Added copyright to hip_module.cpp file
Change-Id: Ifc5f1e251d5c52a5b59f372b3fada938dbecb34a


[ROCm/clr commit: b6ff7df81e]
2016-08-17 10:36:28 -05:00
Aditya Atluri bd70c942c7 corrected issues from hipModule API
Change-Id: I9d07884db20df5632f5a69b1a89a0e6ca531712b


[ROCm/clr commit: a3cb0f37c4]
2016-08-16 16:49:42 -05:00
Aditya Atluri 5513a08601 Added kernel compilation driver apis
1. Added 2 new driver apis, hipModuleLoad, hipModuleGetFunction

Change-Id: If464a7fad178121e3da791c7ac9e17ebc01a9cd0
Issues: When a sample written with them shows Aborted (core dumped) when exiting


[ROCm/clr commit: b8597512ca]
2016-08-16 14:36:25 -05:00