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

122 Коммитов

Автор SHA1 Сообщение Дата
Ben Sander 1b2ab173c1 Tweak thread-safe implementation.
introduce LockedAccessor option so destructor does not unlock.
Allows locks to exist across function boundaries, required
for hipLaunchKernel macro which has several unusual requirements.
(including C comppatibility, must use variadic macro, more).
2016-03-28 21:41:47 -05:00
Ben Sander 6cab7862ae Stream thread-safe checkpoint.
Moving data structures to critical / protected section.
2016-03-28 09:46:40 -05:00
Ben Sander ecd56e1400 Stream thread-safe checkpoint. 2016-03-28 04:22:20 -05:00
Ben Sander c47b5b04ef Protect _stream_id as well.
- move lockedaccessor
- clean up device class.
- add simple ihipDevice constructor.
2016-03-26 11:45:25 -05:00
Ben Sander 4dd77c6612 Make ihipDevice_t thread-safe.
Move critical data into separate class and protect with LockAccessor
wrapper class.

For device, the streams list is the critical data since it is modified when
streams are created or destroyed.   The streams list is accessed in
several places including when synchronizing across all streams on the
device (ie from the default stream).
Other device data is set once by the device cosntructor and is not critical
so

All functions which acquire the LockAccessor now named with "locked_" prefix.
2016-03-26 10:46:20 -05:00
pensun a8ae62d399 fix query of memoryClockRate and memoryBusWidth for both NV and HCC path 2016-03-25 09:24:08 -05:00
Aditya Atluri 2dacc3e161 Added canMapMemory feature to device properties 2016-03-24 07:33:24 -05:00
Aditya Atluri eea49cb66b added CR and hipsetdeviceflags func 2016-03-24 07:04:01 -05:00
Aditya Atluri 1c55019322 Split files based on functionality and changed cmake file 2016-03-24 04:57:30 -05:00
Ben Sander e52c3d9fe0 Partition hip_hcc into sections
Separate files for different categories of HIP API.
Currently just #include into hip_hcc.cpp
2016-03-24 09:28:54 -05:00
Aditya Atluri c1ad70ad4b moved variables to headers 2016-03-23 12:59:52 -05:00
Aditya Atluri 29119bd3d4 reverted back to old infra with cmake added 2016-03-23 11:13:02 -05:00
Aditya Atluri 64c4c70e4f WIP added modular feature for device apis 2016-03-23 07:54:01 -05:00
Ben Sander 3ca91cf327 Update docs:
- Some comments in hip_hcc.cpp
 - document hipHostRegister* flags.
 - expand docs on hipHostRegister/Unregister. Use "register" rather than
   "pin" to describe action these take.
 - change required CUDA version to 6 (require unified memory)
 - remake doxygen.
2016-03-23 23:11:15 -05:00
Aditya Atluri e9e84d2db6 fixed hipHostGetFlags test 2016-03-23 02:45:21 -05:00
Aditya Atluri b1b6d5e648 Remove redundant hpiHostGetDevicePointer 2016-03-23 09:21:02 -05:00
Ben Sander 6fb2367b66 Add USE_AV_COPY (replaces calls to am_copy with new acc_view::copy 2016-03-23 10:30:53 -05:00
Ben Sander f3ac666a7a use the CPU_Agent for memory copies to indicate direction. 2016-03-23 10:29:44 -05:00
Ben Sander 8954e4fb26 Merge branch 'privatestaging' of https://github.com/AMDComputeLibraries/HIP-privatestaging into privatestaging
Conflicts:
	src/hip_hcc.cpp
2016-03-23 03:22:09 -05:00
Ben Sander dc86743b35 Add unique stream_id to devices to improve debug 2016-03-23 03:17:19 -05:00
Ben Sander fa8deac1ad Improve trace API
- Validate compile-time disables.
- Add README.md section explain how to install/use CodeXL tracing
- Add code docs on trace_helper.h
- fix color on hipLaunchKernel to green.
2016-03-23 02:57:52 -05:00
Ben Sander aed1a82ccb HIP_TRACE_API prints function args, and in color 2016-03-23 02:19:49 -05:00
Ben Sander 54704b59dd use codexl marker interface to mark HIP function/begin end.
- Creates markers in HIP group and they show up in CodeXL trace
- Marker text includes HIP functioin arguments
- (Add trace_helper to convert arguments to strings)
- Still need to add HIP_INIT_API for ~30 HIP functions.
2016-03-23 01:17:53 -05:00
Ben Sander 2d0fade1f7 hipHostRegister and hipHostMalloc refactor.
Note hipHostMalloc (not hipHostAlloc or hipMallocHost).
 -  the hipHost* is used for all HIP APIs dealing with Host memory.
    (including hipHostMalloc, hipHostFree, hipHostRegister,
hipHostUnregister, hipHostGetFlags, hipHostGetDevicePointer).
  - hipMallocHost is consistent with "hipMalloc" for allocating device
    memory.  Enumerations hipHostMalloc* also used as optional
    flags parm to hipHostMalloc.
2016-03-22 02:30:10 -05:00
Aditya Atluri 8af8ee2476 Revert "Revert "fixed memory free apis""
This reverts commit 1fa4d0d4b9.
2016-03-21 10:40:42 -05:00
Aditya Atluri 1fa4d0d4b9 Revert "fixed memory free apis"
This reverts commit 71a6b5cb6c.
2016-03-21 10:36:11 -05:00
Aditya Atluri 71a6b5cb6c fixed memory free apis 2016-03-21 10:32:30 -05:00
Aditya Atluri ea352aba6b suppressed warning in hipFreeHost 2016-03-20 15:31:59 -05:00
Aditya Atluri f6b38b18b6 Added feature for --default-streams not working tests and hipcc 2016-03-20 08:08:33 -05:00
Ben Sander 80d708846a Implement hipHostFree on HCC path 2016-03-19 23:25:11 -05:00
Ben Sander 03731020f1 Refactor copy - place common code in resolveMemoryKind. 2016-03-19 22:56:10 -05:00
Ben Sander a88c2b1ec9 Refactor waitALlDevices and async mem copy.
- move waitAllStreams to device member function.
- create separate stream member function for copyAsync, like copySync.
  hipMemcpyAsync now calls the copyAsync.
2016-03-19 05:42:19 -05:00
Ben Sander aaa2429feb Swap in corrected hipHostAlloc (bad merge) 2016-03-19 04:11:08 -05:00
Ben Sander 90ad8ddc5d Merge branch 'privatestaging' of https://github.com/AMDComputeLibraries/HIP-privatestaging into privatestaging
Conflicts:
	src/hip_hcc.cpp
2016-03-19 03:22:09 -05:00
Ben Sander 44522eb607 Fix copy and sync bugs. Remove extra sync in default stream.
- NULL stream was waiting for itself to be empty before each command.
- Force "blocking" streams to wait for NULL to empty.  This was missing
  before.
- async copy was disabling itself via trueAsync=false for common cases.

Refactor:
- rename _null_stream to _default_stream.
- move some null sync function to defaultSync, move to dev member func.
2016-03-19 02:44:26 -05:00
Ben Sander e64174f47a Refactor copy code.
-Move staging buffer locks inside the staging buffer code.
-Remove dedicated per-device completion_signal + per-device lock -
instead allocated signal from the per-stream pool.   This elimintes
the lock and allows more concurrency.
-remove switch HIP_DISABLE_BIDIR_MEMCPY
2016-03-18 03:02:00 -05:00
Ben Sander 3b45e064f9 Refactor staging buffer and sync copies.
- refactor staging buffer to operate on hsa* data structures not
  hc::accelerator.
- use hsa_memory_allocate to allocate staging buffers rather than
  am_alloc.
- Refactor device reset with single member function.  Don't reallocate
  staging buffers on reset.
- Properly track dependencies based on command type.  Add new deps for
  H2D and D2D rather than overloading H2D.
2016-03-17 20:09:10 -05:00
Ben Sander 1b7cc7d921 Refactor to isolate staging buffer code. 2016-03-17 00:20:56 -05:00
Ben Sander a1879ba59b Start separaration of staging_buffer.cpp code.
Still #include staging_buffer.cpp into hip_hcc.cpp.
Directed tests compile hip_hcc to static library and use the library.
2016-03-16 22:26:49 -05:00
Ben Sander 8acb53e160 Checkpoint code cleanup.
- Refactor ihipStream in prep for thread-safe implementation.
- Do some work on PinInPlace implementation.
2016-03-16 21:16:29 -05:00
Aditya Atluri 4b96e8c789 changed flag in hipHostRegister 2016-03-16 08:01:53 -05:00
Aditya Atluri 6beed19460 src/ fixed hipHostAllocDefault flags 2016-03-16 07:32:54 -05:00
Ben Sander 15a8e8f8a0 Merge branch 'privatestaging' of https://github.com/AMDComputeLibraries/HIP-privatestaging into privatestaging
Conflicts:
	src/hip_hcc.cpp
	tests/src/CMakeLists.txt
2016-03-14 15:01:26 -05:00
Ben Sander 0d05517d0a enable DB, comments 2016-03-14 14:40:41 -05:00
Ben Sander 59f0ef2801 Remove ROCR_V2, assume=1 2016-03-12 04:08:13 -06:00
Ben Sander de4bb0ca0e Remove USE_AM_TRACKER (assume 1) 2016-03-12 04:04:57 -06:00
Ben Sander ac272932f6 Improve error reporting.
use throw with error class.
fix bug when memcpyDefault resolved to D2D copy.
2016-03-12 04:02:04 -06:00
Aditya Atluri 3127969d97 Added hipHostRegister for hip with tests and added copyright 2016-03-08 12:57:22 -06:00
Aditya Atluri dfa9051574 v2 added support for unpinned async memcpy 2016-03-08 03:19:50 -06:00
Aditya Atluri 1a61733699 Revert "Fixed passing unpinned memory to async memcpy"
This reverts commit bf53992605.
2016-03-08 03:17:27 -06:00