Ben Sander
fc7eefb5c8
Cleanup files from code review.
...
- Remove some stale code
- Update docs
- Correct define for __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__
Change-Id: Ic5e3cdb8269b1c18f6d2693700b55e08c4d0080e
[ROCm/clr commit: aa3e04cf9a ]
2016-10-15 11:51:20 -05:00
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
4c69e2c2f8
Fix HIP_USE_PRODUCT_NAME detection.
...
Change-Id: I6879ec3a11845bea66a18a9328bd4eaf54713420
[ROCm/clr commit: 45bc107ad0 ]
2016-10-13 11:51:53 -05:00
pensun
eecfd8e141
Add ifdef guard for the feature requires ROCm1.3
...
Change-Id: I7154517c47000c37fe5eb09a3c1cf2a9aacbe27c
[ROCm/clr commit: 0ac70e7184 ]
2016-10-13 10:57:31 -05:00
Aditya Atluri
b82a22ff7a
added constant memory property to 16KB
...
Change-Id: If067b4057c2e3fc0c26cf4604a1d4fac7f139b12
[ROCm/clr commit: e25a1e50b3 ]
2016-10-13 10:47:40 -05:00
pensun
f638d13f7c
Change to query device name using HSA_AMD_AGENT_INFO_PRODUCT_NAME;
...
Note: this commit depends on ROCR runtime in ROCm 1.3 release.
Change-Id: I90385ef6d11ee8a1e8adae1d3fdf21747347544c
[ROCm/clr commit: 44cc44011b ]
2016-10-12 20:01:30 -05:00
Aditya Atluri
cd32c9418e
Added hipDeviceGetLimit api
...
1. hipDeviceGetLimit API for HCC path is added
2. Test for hipDeviceGetLimit API is added
3. The feature added only supports querying heap size
4. Corrected indents for malloc and free device functions
5. Removed redundant data structures
6. Added g_heap_malloc_size to store the heap size
Change-Id: If48d1b0ce9270e994f1c542cc283ddbb14746bbb
[ROCm/clr commit: e5325a1ab4 ]
2016-10-12 19:58:48 -05:00
Aditya Atluri
caa6a298e7
added malloc and free device functions
...
1. Added malloc and free device functions
2. Added test which check malloc and free functions
TODO: Need to add support for multiple device. Works only on one device (multi device support id NOT available).
Change-Id: Id11fc36463915d6ad46c264d5a20c8feb2d2c17c
[ROCm/clr commit: 2918ff273d ]
2016-10-12 19:08:34 -05:00
Ben Sander
a79b334fbc
Add DISABLE_COPY_EXT option.
...
[ROCm/clr commit: 250f711ed0 ]
2016-10-05 12:18:42 -05:00
Ben Sander
8e0733f958
Add HIP_BLOCKING_SYNC environment var to control stream sync behavior.
...
[ROCm/clr commit: 6950d3f9e9 ]
2016-10-05 12:18:42 -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
d5d764a4d4
Refactor asyncCopy and syncCopy to fix deadlock case.
...
- Minimize time that locks are held.
- Eliminate copy code that locked stream and ctx at same time.
- Stream was locked to ensure thread-safe enqueue to the queue.
- Devices were locked to query peer-lists.
Change-Id: Ibe8880bb7fb995a3da8f90ff911f212d81525018
[ROCm/clr commit: 806e58ca63 ]
2016-09-27 15:45:40 -05:00
Ben Sander
a0ec18c516
Add debug option to print ThreadID with each message.
...
Also print messages with single fprintf to prevents threads from
interleaving.
Change-Id: Ib3999fe6b1e67b4a16cd7dcde82f3dfc99dd48ff
[ROCm/clr commit: 4fd4168796 ]
2016-09-27 15:45:40 -05:00
Ben Sander
46a4854bae
Fix signal resource issue.
...
Remove memory leak with new hc::completion_future.
Implement HIP_LAUNCH_BLOCKING with queue-level wait.
Change-Id: I45975f81c4d239fdeed7776970988d28449865dc
[ROCm/clr commit: f6717e326e ]
2016-09-26 16:47:32 -05:00
Ben Sander
4cf9803703
Peer-to-Peer improvements.
...
- Bug fix for peer visibility. Now contexts correctly detect when they can use SDMA for P2P vs staging buffers.
- Interface to new HCC copy_ext function.
- Improve context and peer print /debug options.
- Add comments and usage to hipPeerToPeer_simple test.
[ROCm/clr commit: 944d4eaa18 ]
2016-09-22 14:21:19 -05:00
Ben Sander
03866f0ee5
Remove unpinned_copy code. Other cleanup.
...
Change-Id: Ie3f71439cf1ba729ef223d078917c403d3de879a
[ROCm/clr commit: 926aefa930 ]
2016-09-22 14:21:19 -05:00
Ben Sander
8e55e13469
Cleanup. Remove cfs, ihipSignal_t, staging buffer calls.
...
Change-Id: I8bb67c484e3a65be06a03665f059217930da2bed
[ROCm/clr commit: 5bc18c8603 ]
2016-09-22 14:21:19 -05:00
Ben Sander
8340e57194
Cleanup: Remove HIP signal pool.
...
Change-Id: Icebfd0509d12396cc5933d5556d68b53e1be36e0
[ROCm/clr commit: 17e21309f1 ]
2016-09-22 14:21:19 -05:00
Ben Sander
dbbd5ce037
Remove HIP command dependency tracking.
...
Change-Id: I991c13bc5108193959ba70f9f6f9c692c9ad3a5b
[ROCm/clr commit: c365785c5c ]
2016-09-22 14:21:19 -05:00
Ben Sander
bafa586cf5
Cleanup, remove preCopyCommand.
...
Change-Id: I3768d3789a99be8136b43179d4152fa1875665cb
[ROCm/clr commit: b0509c5a58 ]
2016-09-22 14:21:19 -05:00
Ben Sander
c291e03ce8
Change HIP async copy to call av::copy_async.
...
Change-Id: I4274b63ced3940d5249c32bd9d156296529c70e8
[ROCm/clr commit: 3596901c3d ]
2016-09-22 14:21:19 -05:00
Ben Sander
8240ac127f
Use HCC's synchronous accelerator_view::copy
...
Replace large block of HIP code with a call to HCC av::copy().
Change-Id: Ic32e1801cf8d4cd116ac02b72c41b1a1e4b6065c
[ROCm/clr commit: 8598d8c6d3 ]
2016-09-22 14:21:19 -05:00
Ben Sander
2f4c30ff79
Remove USE_AV_COPY, USE_PEER_TO_PEER fallback paths.
...
Change-Id: I9c20173e62029c4caebabc98784c6d7697758e4f
[ROCm/clr commit: 60f797cc5a ]
2016-09-22 14:21:19 -05:00
Ben Sander
16f818b60f
Remove HIP_STAGING_BUFFER
...
Code simplification/cleanup:
Remove stale fallback paths that uses something besides the unpinned engine.
Remove HIP_STAGING_BUFFER env var - now is const 2, 0 no longer has
special meaning.
Change-Id: I7d24cdd1067dd0c244e87b6a83897cb135d307e7
[ROCm/clr commit: 39750da9a5 ]
2016-09-22 14:21:18 -05:00
Ben Sander
872c63b03a
Move isLargeBar to UnpinnedCopyEngine constructor.
...
Change-Id: I7a7d3a40b1d4e0c6ec856658a6a70e5e70d287ce
[ROCm/clr commit: 17d7fc586e ]
2016-09-22 14:21:18 -05:00
Ben Sander
435c528fd4
Refactor Staging Buffer CopyDeviceToHost
...
Use copyMode. Embed algorithm selection inside the unpinned class.
Change-Id: Ic75fd5931717a3160904402794bbed3ccd445112
[ROCm/clr commit: 77c86934c1 ]
2016-09-22 14:21:18 -05:00
Ben Sander
91b43c493b
Refactor staging buffer CopyHostToDevice.
...
- Move algorithm selection inside Unpinned class.
- Refactor function names.
- Use size_t for size threshholds.
Change-Id: Iac4de652ac9d49acbf527aa0849e388b8ecd8486
[ROCm/clr commit: e77d75c1c1 ]
2016-09-22 14:21:18 -05:00
Ben Sander
6b6b0d6b58
Updates docs for hipHcc* functions, move to header
...
[ROCm/clr commit: b4bc101c96 ]
2016-09-22 13:05:47 -05:00
Aditya Atluri
29a9549a47
added more error codes to hipErrorGetString
...
Change-Id: I80c675905d94813502040fd0caa07985fa8c7dcc
[ROCm/clr commit: 6cb5a13a2b ]
2016-09-15 11:28:18 -05:00
Aditya Atluri
18756a8e91
added new error reporting case
...
Change-Id: I5f0a37dbe396412f5602d04df19d538e451c2696
[ROCm/clr commit: 2c12394d52 ]
2016-09-15 10:50:26 -05:00
Aditya Atluri
a482dd2ae0
Added signal management which passes stress tests
...
Change-Id: I7e1660a8ca2c5ee580a91f76eae9a58ca49f0457
[ROCm/clr commit: 5845a2d8c6 ]
2016-09-08 14:52:51 -05:00
Ben Sander
c75953a822
Add hipStreamQuery
...
Change-Id: Ib0813b1065feba4fe9ae861d24cfc6f9c5f580be
[ROCm/clr commit: fd67689114 ]
2016-09-07 15:18:34 -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
Ben Sander
98019e5f79
Only use ihipLogStatus from top-level HIP functions.
...
Change-Id: I07e9c088d5c16a79ed52cb008a798889a656016c
[ROCm/clr commit: 9ee9284306 ]
2016-09-02 09:46:59 -05:00
Ben Sander
fe85edad3f
Use create_blocking_marker for WaitEvent implementation
...
Change-Id: Ib3113f69a14e48b9fe0558d7b455148e478d8eed
[ROCm/clr commit: 9a99000a62 ]
2016-09-02 09:46:59 -05:00
Ben Sander
938933ca2f
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/clr commit: 02f65a483c ]
2016-09-02 09:46:59 -05:00
Aditya Atluri
eb6863017c
remove HIP_INIT_API from ihipSynchronize
...
Change-Id: Ibe0739efe55573c023212d9c28ba847c777e434c
[ROCm/clr commit: 7fdebfb8e3 ]
2016-08-29 21:42:22 -05:00
Ben Sander
78cfa5f6d6
Refactor trace code for hipLaunchKernel.
...
- Use standard print functions for streams.
- Add HIP_INIT macro, for cases where we want to initialize HIP but not
log an API (ihipPreKernelLaunch).
Change-Id: If43cf8a363d918bcd3722a2e6a965d4cfa2e03e7
[ROCm/clr commit: fa9b95838a ]
2016-08-29 18:37:57 -05:00
Aditya Atluri
fa734c5a6a
Added explicit memory copy direction apis
...
- Fixed stale printf in context api
- Added 4 sync memcpy apis
1. hipMemcpyHtoD
2. hipMemcpyDtoH
3. hipMemcpyDtoD
4. hipMemcpyHtoH
- Added test for added apis
Change-Id: I4a9c382445b62631f8d0bcbb9a670322288b72b1
[ROCm/clr commit: f722a132a4 ]
2016-08-26 13:11:01 -05:00
Aditya Atluri
82deaeb581
Changed how hipEvent_t is typedefed internall
...
- Mapped hipEvent_t directly to ihipEvent_t* instead of a handle
Change-Id: I5a8bcca0ef962932e0738c03eb1fc914d23022ae
[ROCm/clr commit: 25be4fb532 ]
2016-08-25 14:34:41 -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
Rahul Garg
f1f04949ac
Added support for hipCtxSynchronize and hipCtxGetFlags,modified hipDeviceSynchronize
...
Change-Id: If7bac667a262fa8c0cb3dc93e97f2534855acd07
[ROCm/clr commit: b0ba622ed5 ]
2016-08-22 16:15:27 +05:30
Ben Sander
a4bfccf628
Context update.
...
- Remove tls_deviceID.
- Add first passing test.
Change-Id: If3e2f254abf589028cfe4f9e6369745f04160de0
[ROCm/clr commit: a9bcee3d77 ]
2016-08-10 08:59:47 -05:00
Rahul Garg
dbf9fd8312
Changed StagingBuffer class to UnpinnedCopyEngine
...
Change-Id: I1e212bfc8030dcf225ecf78fd7b23fda9b1de92f
[ROCm/clr commit: d08b1239ee ]
2016-08-09 21:29:42 +05:30
Rahul Garg
cb771c60d3
Moved sync copy decision logic to staging buffer class
...
Change-Id: I5c398772375fcc1f174a7597eea1215ce7bf80b4
[ROCm/clr commit: 4044cb412c ]
2016-08-09 09:28:18 +05:30
Ben Sander
0c8ca4b37d
Add initial context implementation.
...
APIs: hipInit, hipCtxCreate.
Track TLS default ctx. Set deviceID now changes the ctx.
Add first context test.
Change-Id: If1cb9989b5a04a36147e25e84904336c7b6f3d88
[ROCm/clr commit: f19f2248bf ]
2016-08-08 17:49:02 -05:00
Ben Sander
c85f34bf8a
Code cleanup, use camelCase where appropriate.
...
Change-Id: I5a7ec50df8bbb3e7a3b313c0b12e2dd55ae4a09c
[ROCm/clr commit: ac173c3ae8 ]
2016-08-08 14:54:38 -05:00
Ben Sander
3ee6e7f8ab
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/clr commit: d09b19bb6c ]
2016-08-08 11:55:57 -05:00