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

46 Коміти

Автор SHA1 Повідомлення Дата
Maneesh Gupta bbfc08f419 Move include/* to include/hip/*
Change-Id: I7a7b2839b4df59c7a4c503550f99fdc9e45c0f54
2016-10-04 22:17:18 +05:30
Ben Sander 806e58ca63 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
2016-09-27 15:45:40 -05:00
Ben Sander f6717e326e Fix signal resource issue.
Remove memory leak with new hc::completion_future.
Implement HIP_LAUNCH_BLOCKING with queue-level wait.

Change-Id: I45975f81c4d239fdeed7776970988d28449865dc
2016-09-26 16:47:32 -05:00
Rahul Garg c313836013 Removed deprecated hipHostAlloc
Change-Id: Ia592a3545c5d72f37e049ce29f910e404323c01c
2016-09-26 10:58:46 +05:30
Rahul Garg f5b463702e Removed deprecated hipMallocHost
Change-Id: I3141fe05a34b6a306297a30721509965f49ccb97
2016-09-26 05:52:21 +05:30
Rahul Garg 3a6acd044b Removed deprecated hipFreeHost
Change-Id: I9747ea3993090e0da6a2e1f5e9ce318762bc03e1
2016-09-26 05:35:14 +05:30
Ben Sander 944d4eaa18 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.
2016-09-22 14:21:19 -05:00
Ben Sander b4bc101c96 Updates docs for hipHcc* functions, move to header 2016-09-22 13:05:47 -05:00
Rahul Garg 8842a0d5b8 Added return error code hipErrorInvalidValue in hipMemGetInfo
Change-Id: If01b012136b655ff8eb4878eb703dfe3e6a36530
2016-09-17 23:54:20 +05:30
Rahul Garg cb3bff0a0d Partial updates of error codes for Memory APIs
Change-Id: If924867cc62f56dc9eaf81f5499ba66f417c393a
2016-09-16 12:59:41 +05:30
Aditya Atluri c3ab5a8df8 Added async memcpy driver api
Change-Id: I90e8a078d668a408e79f9e1142e7534771467a4f
2016-09-09 10:21:52 -05:00
Ben Sander 8e883ab666 hipStreamWaitEvent update.
Add passed to hipStreamWaitEvent test.
Fix pointerAttrib test to work with new and old HCC versions.
Minor code touchup.

Change-Id: I139ba6ce9f6bf2b4bee89aebdec5981b4346ffc0
2016-09-02 09:46:59 -05:00
Ben Sander 02f65a483c 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
2016-09-02 09:46:59 -05:00
pensun 4ed2035dd2 Modify hipMalloc to take size of 0 and return NULL pointer for it.
Modify hipMemoryAllocate test for this change.

Change-Id: I884aee0cd5fe0c60aebb4cb37cdbb4833c5bd0c7
2016-09-01 13:08:30 -05:00
Ben Sander eb61114739 remove stray printf
Change-Id: Ie64778a83dfe684ffaab3c31bc3d09b713f825b9
2016-08-29 18:36:30 -05:00
Aditya Atluri fb0c432095 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
2016-08-29 15:05:12 -05:00
Aditya Atluri f722a132a4 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
2016-08-26 13:11:01 -05:00
Ben Sander ac173c3ae8 Code cleanup, use camelCase where appropriate.
Change-Id: I5a7ec50df8bbb3e7a3b313c0b12e2dd55ae4a09c
2016-08-08 14:54:38 -05:00
Ben Sander 6dbe554894 Move copy kernel templates into hip_memory.cpp
Change-Id: I862529f3fa8232372c6bacaa5d36f035bbdd32a1
2016-08-08 12:07:12 -05:00
Ben Sander d09b19bb6c 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
2016-08-08 11:55:57 -05:00
Ben Sander 0d16565061 Change Device->Ctx
Change ihipDevice_t -> ihipCtx_t (new)
Change ihipGetTlsDefaultDevice->ihipGetTlsDefaultCtx
Some other changes from device->ctx where appropriate.

Change-Id: I5c4ae93b2fd42c6303aa23d748eb166b7431925d
2016-08-07 21:47:12 -05:00
pensun 6db08e5135 Add empty stubs for threadfence family routines, changes include:
- stubs and documentation in include/hcc_details/hip_runtime.h
    - stubs with "no-op" in src/hip_memory.cpp
    - document update in hip_kernel_language.md, add suggestions to
    disable L1 and L2 caches when using the threadfence routines.

Change-Id: Ic0753170f802003055bca9d7476d7f48817b98b7
2016-07-22 10:40:58 -05:00
Maneesh Gupta b485470819 Replace calls to ihipInit with use of HIP_INIT_API macro
Change-Id: Iabf7df79f0238a8ddffea4607fe945df36642850
2016-07-22 15:46:55 +05:30
Maneesh Gupta 7d5cffdc17 Merge branch 'hiparray' into amd-develop
Change-Id: I63ca7b1db7b593ac5cfb3fd7cd5d08d6e4075a4c
2016-07-21 12:29:56 +05:30
Ben Sander 44d117ba63 Clean up old work-week and USE_* refs
Change-Id: I929c979fa085f8e5205194cbccca46e9b5516aa9
2016-06-17 15:18:57 -05:00
Ben Sander 6a2a140f34 NVCC improvements.
- Complete translation tables for cudaError <-> hipError_t.
- Remove some odd errors that were not correctly translated or not used.
- Add HIPCHECK_API to test infrastructure.  Used for negative testing
  an API ; if a mismatch occurs it shows the expected return error
  code.  Can also print a warning rather than error.
- Enable hipMemoryAllocate on NV system, and review error coded.
- Add hipErrorName to nvcc.

Change-Id: I680427dcf32a5796d5913cf9e7f3b4c6f6b91599

Conflicts:
	tests/src/CMakeLists.txt

Bug fixes and improved docs for hipFree and hipHostFree.

    - Passing NULL pointer initialized runtime and return hipSuccess
      (not an error like before).
    - add negative test for this. (hipMemoryAllocate, improved)
    - Match NVCC errors for invalid pointers, add to test.
    - Update hipFree and hipHostFree docs.
    - hipGetDevicePointer always set *devicePointer=NULL, even for
      invalid flags.
    - Gate shared memory usage on specific HCC work-week.

Change-Id: I533b4fd3280a3d6cdbf05eb768976f0c7506c012
2016-06-16 06:13:51 +05:30
Ben Sander 79983a1f4b Merge branch 'privatestaging' into p2p 2016-05-02 11:10:10 -05:00
Aditya Atluri f571c5ec7c fixed hipmemset to use native ihip api 2016-04-25 11:05:30 -05:00
Ben Sander 9329fb8c92 Add USE_HCC_LOCK_API.
Default off, if set will compile assuming HCC lock APIs exist.
2016-04-18 23:50:52 -05:00
Ben Sander 6abfa13c34 Fixes for P2P and hipDeviceReset
- devicereset would lose track of default stream and thus subsequent
  synchronization calls might not actually sychronize.
- Also deviceReset now correctly frees streams.
- fix waits in P2P staging copy - first phase (Device0-to-Staging) must
  wait for second phase (Staging to Device1) to finish draining the
  buffer.
2016-04-18 20:49:33 -05:00
Aditya Atluri dc61929a3d Corrected Memcpydefault 2016-04-16 17:10:13 -05:00
Aditya Atluri e8902a6e20 improved error returns for hipHostRegister/UnRegister functions 2016-04-15 10:42:31 -05:00
Aditya Atluri 26ee986774 added more features to hipHostRegister 2016-04-15 10:32:01 -05:00
Aditya Atluri 109154f03f added hipHostRegister/UnRegister api 2016-04-15 10:08:10 -05:00
Ben Sander efffb0ed86 Clean up disable.
Add USE_HCC_LOCK (disabled)
Disable USE_PEER_TO_PEER.
2016-04-11 09:09:36 -05:00
Ben Sander 9e7efd7c65 P2p checkpoint.
- set USE_PEER_TO_PEER=3 (requires HCC "am_memtracker_update_peers")
- when enabling peer, turn it on for previously allocated memory.
- hipDeviceCanAccessPeer is no longer self-ware (self does not qualify
  as a peer)
- device peerlist always includes self, so when we call allow_access
  we never remove self access.
- hipDeviceReset() removes old peer mappings.
2016-04-11 07:58:59 -05:00
Ben Sander a4d97c3172 Remove stray debug msgs, hipInfo don't print self as peer. 2016-04-11 07:58:58 -05:00
Ben Sander 173cff4c1e fix bugs in P2P implementation
- addPeers polarity reversed, would never add.
- check allow_access return value, pipe error to hipMalloc.
2016-04-11 07:58:58 -05:00
Ben Sander 97772d6363 For P2P, use the peer list when allocating Device memory or pinned host.
Each new allocation is automatically mapped into the address space of
all enabled peers.
2016-04-11 07:58:58 -05:00
Aditya Atluri 883954fce2 added hipHostRegister support no multi-gpu 2016-04-11 10:28:16 -05:00
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 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
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