Commit Graph

56 Commits

Author SHA1 Message Date
Jeff Daily e428d45eb2 add IPC event support (#1996)
[ROCm/hip commit: ef596cd088]
2020-04-17 10:31:22 +05:30
Jeff Daily a2915ae475 fix hipStreamAddCallback, block future work on stream (#1934)
[ROCm/hip commit: 01d661b159]
2020-03-19 16:16:04 +05:30
Evgeny Mankov abef353b5b [HIP] Clean-up deprecated HIP error codes
hipErrorMemoryAllocation -> hipErrorOutOfMemory
hipErrorInitializationError -> hipErrorNotInitialized
hipErrorMapBufferObjectFailed -> hipErrorMapFailed
hipErrorInvalidResourceHandle -> hipErrorInvalidHandle


[ROCm/hip commit: 4921678b6c]
2019-12-23 17:01:35 +03:00
satyanveshd 3848cd97ea fixed directed tests fail when hcc bumped to 3.0 (#1678)
Handled the HCC version check appropriately as few of the directed tests (SWDEV-212161) were failing when hcc was bumped to 3.0.

[ROCm/hip commit: 6b06911ef1]
2019-11-20 21:37:52 +05:30
Sarbojit2019 6679cd3998 Revert [HIP] Fixed hipStreamAddCallback (#1674)
This reverts commit fa1e44aa0e.
Addresses SWDEV#212675.

[ROCm/hip commit: 153a959280]
2019-11-20 11:55:46 +05:30
Sarbojit2019 fa1e44aa0e [HIP] Fixed hipStreamAddCallback [SWDEV#165185] (#1425)
Fixed hipStreamAddCallback() as requested in SWDEV#165185
Added unit test to test the behavior


[ROCm/hip commit: 45613311d7]
2019-11-07 13:18:12 +05:30
Jeff Daily 9b44993343 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


[ROCm/hip commit: 1eb3dbf065]
2019-08-05 09:51:02 +00:00
Jeff Daily 4094b62407 remove stream locks where it is safe to do so
[ROCm/hip commit: f096a3239e]
2019-07-22 17:38:51 +00:00
Aryan Salmanpour a2655fd90a [hip] Move _criticalData of ihipStream_t class to private section and use criticalData() to access it (#1177)
[ROCm/hip commit: 999f45fc11]
2019-07-04 00:42:19 +00:00
Anusha Godavarthy Surya f1d6b56fc4 Added missing NULL checks and corrected API return values as per validation
[ROCm/hip commit: 3d5f6be1c7]
2019-06-27 00:19:05 +05:30
Rahul Garg 5d6fd17fbe Add extension for kernel concurrency on same stream
[ROCm/hip commit: 59081c69fc]
2019-03-06 12:55:39 +05:30
root dbc30b7800 rebase to master, tracer related changes
[ROCm/hip commit: 091124a766]
2018-11-13 15:50:34 +00:00
Evgeny 73e3c4ec42 renaming HIP_INIT_CB_API to HIP_INIT_API
[ROCm/hip commit: e5ba097afd]
2018-11-13 15:33:26 +00:00
Evgeny 0a58dc9b7b adding activity prof layer
[ROCm/hip commit: b8b1637ef7]
2018-11-13 15:33:26 +00:00
Maneesh Gupta 90d15c13a1 Make HIP functional again with HCC from ROCm 1.9.x
Change-Id: I214acdfd0b79dcf783993e44fe31baee64fd4dc3


[ROCm/hip commit: 0703a2d0f0]
2018-10-24 10:41:56 +05:30
Maneesh Gupta b35590db18 Implementation for stream priority
- Requires ROCm 1.9.x or higher
- Requires HCC with PR#886 merged

Change-Id: Id7c95ea091ee610e80c9ad815f1cb989cba570ca


[ROCm/hip commit: da64156fb2]
2018-10-05 16:27:46 +05:30
Siu Chi Chan 4b25b76898 callback handler: don't need to wait for the thread to become ready
[ROCm/hip commit: d3a9985f10]
2018-06-02 17:55:37 -04:00
Maneesh Gupta 4f42ee762d Apply .clangformat to all repo source files
Change-Id: I7e79c6058f0303f9a98911e3b7dd2e8596079344


[ROCm/hip commit: 1ba06f63c4]
2018-03-12 11:29:03 +05:30
Maneesh Gupta 02bedf46dc Implement hipStreamAddCallback
Change-Id: Ib851e4d86ba9c8406ca37b88162ea483ccbc9d36


[ROCm/hip commit: cebb070d30]
2017-12-19 16:06:14 +05:30
Ben Sander 465b24123b hipStreamWaitEvent returns success if event created but not recorded
[ROCm/hip commit: 16708dd2e0]
2017-11-06 23:49:31 +00:00
Ben Sander f80896d58b Make hipEvent_t thread safe.
Support re-recording of same event by different threads.

- Add criticalData structure to hipEvent_t, similar to mechanism used
  for streams, contexts, device.  Events are always locked
  after streams to avoid deadlock.
- ihipEvent_t::locked_copyCrit can be used to copy critical state
  including marker.  The critical state in the event can then
  be re-recorded.
- refactor hipEventElapsedTime.  Remmove stale debug code, native signal
  refs.


[ROCm/hip commit: 4a2e6f8955]
2017-11-06 23:49:25 +00:00
Ben Sander 6a4c50cf6c Set event state AFTER it is recorded.
[ROCm/hip commit: 4c3b65a5cd]
2017-11-05 10:33:18 -06:00
Ben Sander e88ef63bc8 Add ns-level timer for HIP API routines
Refactor some miuses of ihipLogStatus, these should only be in top-level
HIP APIs and should be paired with HIP_API_INIT calls.


[ROCm/hip commit: 7e908bdec8]
2017-10-30 20:20:51 +00:00
Ben Sander cbbb0826f2 hipStreamQuery uses av::is_empty. Add HIP_FORCE_NULL_STREAM.
[ROCm/hip commit: 4ac6d643c1]
2017-08-31 03:00:14 +00:00
Ben Sander 2a23d6dbe7 Refactor hipStreamWaitEvent
- Null streams use same flow as non-null.
- Add HIP_SYNC_STREAM_WAIT
- Resolve null stream.


[ROCm/hip commit: 882dab4536]
2017-08-31 03:00:14 +00:00
Ben Sander bd434502db Lock streams when waiting on event completion or querying event safety.
[ROCm/hip commit: 6ff74d0e97]
2017-08-28 18:40:16 -05:00
Ben Sander 542bd863a2 Add some new HIP_TRACE_API options.
[ROCm/hip commit: e3161bb40e]
2017-08-16 04:00:33 +00:00
Ben Sander 445042f916 Fix HIP_SYNC_NULL_STREAM=0 mode.
- Fix null-stream sync
- hipStreamDestroy of null stream returns hipErrorInvalidResourceHandle
- Update documentation.
- Add tests for null stream sync, hipEventElapsedTime.
- Rename internal enum hipEventStatusRecorded to hipEventStatusComplete
- refactor hipStreamWaitEvent to streamline control-flow


[ROCm/hip commit: 39c18e5e5f]
2017-06-05 08:50:22 -05:00
Ben Sander 715aeef97c Add isDefaultStream() accessor.
Fix code that checked for stream==nullptr after stream had been
resolved to a "true stream".


[ROCm/hip commit: b251d72917]
2017-05-26 13:46:48 -05:00
Ben Sander 07865c3a02 Remove HIP_MAX_QUEUES (replaced with HCC_MAX_QUEUES)
[ROCm/hip commit: d0ef9d8462]
2017-05-23 23:48:01 -05:00
Ben Sander a55ce5bee4 Add initial HIP_SYNC_NULL_STREAM=0 mode.
This eliminates host-synchronization for null stream.  Instead, the
null-stream uses GPU-side events to wait for other streams.
Default is OFF pending additional testing.

Add enhanced null-stream test.

Also refine HIP_TRACE_API.


[ROCm/hip commit: 27877f8854]
2017-05-16 19:04:25 -05:00
Aditya Atluri ccf799c453 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/hip commit: b9091ba818]
2017-03-31 12:11:34 -05:00
Aditya Atluri 5de29029cd changed copyright year from 2016 to 2017 in src directory
Change-Id: Idb97db509b2b4b1656b2df7a14a62ade38c9d574


[ROCm/hip commit: 73fcce26f9]
2017-01-11 18:05:41 -06:00
Ben Sander 1908d9504b Add HIP_MAX_QUEUES feature.
Includes some tricky manipulation of the locks for contexts and streams.
issue is that stealing a stream requires we lock the context to
walk the streams to find a victim.  To avoid deadlock, we can't
have a stream locked when we lock the context.  This implementation
releases the stream lock, then acquires the context and selects the
victim.
A more stable implemenation might be to copy the stream list
from a context so that a lock is not required to walk all streams.
Smart shared_ptr could be used to prevent the streams from being
deallocated during the walk.


[ROCm/hip commit: a3e0012567]
2017-01-09 21:02:56 -06:00
Ben Sander bbb1485a83 First pass at virtualized queue support.
Also updated stream debug messages to consistently use trace_helper.


[ROCm/hip commit: 93fbc9cf7b]
2017-01-09 21:02:53 -06:00
Ben Sander 72f6afab45 tolerate spaces in hip args
[ROCm/hip commit: 3a42a7642a]
2017-01-09 20:57:13 -06:00
pensun 9f4cb7d4de Add workaround for hipStreamAddCallback function: call stream synchronize on host and then add execute the call back function
Change-Id: If361f8e053949904b19b9e09245d267f05e29f7b


[ROCm/hip commit: 1f11a9554e]
2016-10-22 23:59:39 -05:00
Ben Sander c11b6f511b Move some internal headers from "include/hip/" to src.
Change-Id: I7041bd5c803d9318979f4a7c1d658445c614691e


[ROCm/hip commit: 9315ac1a29]
2016-10-18 22:27:16 -05:00
Maneesh Gupta dd60b971d1 src/*: Update copyright header
Change-Id: I455f5d0d12fe9cb39a3ba873bd22b4c25ed07cbf


[ROCm/hip commit: 8471682f26]
2016-10-15 22:55:22 +05:30
Ben Sander dda8fb6596 Don't save error status on ihip function.
[ROCm/hip commit: b4a783efa1]
2016-10-05 12:18:42 -05:00
Maneesh Gupta fc58842fcf Move include/* to include/hip/*
Change-Id: I7a7b2839b4df59c7a4c503550f99fdc9e45c0f54


[ROCm/hip commit: b951cc99ed]
2016-10-04 22:17:18 +05:30
Ben Sander d71686d4f5 Remove USE_AV_COPY, USE_PEER_TO_PEER fallback paths.
Change-Id: I9c20173e62029c4caebabc98784c6d7697758e4f


[ROCm/hip commit: e843d8cb51]
2016-09-22 14:21:19 -05:00
Ben Sander 6445921e03 Add hipStreamQuery
Change-Id: Ib0813b1065feba4fe9ae861d24cfc6f9c5f580be


[ROCm/hip commit: 4e994a3025]
2016-09-07 15:18:34 -05:00
Ben Sander c394892227 remove printf
Change-Id: I36510a7ff0425f05a6d0b9c65cda4397c9cc2d95


[ROCm/hip commit: 64bc513df9]
2016-09-02 17:50:31 -05:00
Ben Sander 1edcb06701 hipStreamWaitEvent update.
Add passed to hipStreamWaitEvent test.
Fix pointerAttrib test to work with new and old HCC versions.
Minor code touchup.

Change-Id: I139ba6ce9f6bf2b4bee89aebdec5981b4346ffc0


[ROCm/hip commit: 0923c2d261]
2016-09-02 09:46:59 -05:00
Ben Sander 71f898d534 Use create_blocking_marker for WaitEvent implementation
Change-Id: Ib3113f69a14e48b9fe0558d7b455148e478d8eed


[ROCm/hip commit: aa823871db]
2016-09-02 09:46:59 -05:00
Ben Sander bb0afa4e38 Refactor for stream->_av.
- move _av into stream critical section.  ( HCC accelerator_view is not
  thread-safe but HIP steram is. )
- Refactored many places in code that need to acquire critical section.
some were previously thread races, ie enqueueing marker.

-remove support for GRID_LAUNCH_VERSION < 20
-Enable USE_AV_COPY based on HCC work-week.
- Review hipModule docs, some calrity/editing.

Change-Id: I3ce7c25ece048c3504f55ecd4683e506bb1fc8b6


[ROCm/hip commit: e76a272d48]
2016-09-02 09:46:59 -05:00
Ben Sander 57df8a3967 Split ihipCtx_t into ihipCtx_t and ihipDevice_t .
Major change to existing code base.
    Ctx holds streams, enables peers, and flags.
    Device holds accelerator, hsa-agent, device props.

Add hipCtx_t.

Add peer APIs that accept hipCtx_t (in addition to deviceId)

Compiles and passes directed tests.

Change-Id: Iddab1eb9edbf90caad2ef5959c6b811d658197f1


[ROCm/hip commit: cfdacab32f]
2016-08-08 11:55:57 -05:00
Ben Sander ee356ad0d4 Change Device->Ctx
Change ihipDevice_t -> ihipCtx_t (new)
Change ihipGetTlsDefaultDevice->ihipGetTlsDefaultCtx
Some other changes from device->ctx where appropriate.

Change-Id: I5c4ae93b2fd42c6303aa23d748eb166b7431925d


[ROCm/hip commit: 2dc3d3238b]
2016-08-07 21:47:12 -05:00
Ben Sander 9e3ac64c54 Stream thread-safe checkpoint.
Moving data structures to critical / protected section.


[ROCm/hip commit: 3f18bab2c7]
2016-03-28 09:46:40 -05:00