Commit Graph

125 Commits

Author SHA1 Message Date
Alex Voicu abf92dd6e7 Change memset kernel to use memcpy instead of placement new. Simplify indexers.
[ROCm/clr commit: d5c8de3f41]
2017-11-28 19:45:47 +00:00
Alex Voicu 579a3187da Merge remote-tracking branch 'origin/master' into feature_use_module_based_dispatch_instead_of_pfe
# Conflicts:
#	src/hip_module.cpp


[ROCm/clr commit: d37a5a6008]
2017-11-28 17:29:11 +00:00
Rahul Garg 212afdf56b Fixed review comments
[ROCm/clr commit: 38029f2849]
2017-11-21 21:19:06 +05:30
Rahul Garg dc2c56c43d Changed function hipMemcpy_2D to hipMemcpyParam2D
[ROCm/clr commit: 24307fe5c4]
2017-11-21 12:36:24 +05:30
Alex Voicu 1366b2d5ae Refactor the __device__ versions of memset and memcpy to be less awkward i.e. not return nullptr as opposed to the destination pointer (it can only be assumed it was done for maximum confusion) and actually unroll as they claim to. Change all of the {to, from}Symbol functions to use hipModuleGetGlobal, as opposed to hc::accelerator::get_symbol_address which is no longer valid with module based dispatch.
[ROCm/clr commit: f8c1c1b38e]
2017-11-21 02:40:34 +00:00
Rahul Garg bb8c31c198 Texture driver APIs support
[ROCm/clr commit: 1851c153f6]
2017-11-09 22:10:55 +05:30
Alex Voicu 142213a52b Clean up trailing whitespace so as to reduce noise in #246.
[ROCm/clr commit: 0ad1308efd]
2017-11-08 00:08:55 +00:00
Alex Voicu 21d1d3f1ed Merge remote-tracking branch 'origin/master' into feature_use_module_based_dispatch_instead_of_pfe
# Conflicts:
#	src/hip_module.cpp


[ROCm/clr commit: 17753cbd92]
2017-11-03 10:53:39 +00:00
Alex Voicu 840895525a Correctly deal with functions from shared objects, wherein the program visible VA == so_base_va + st_value(function_symbol). Remove quaint usage of pfe for hipMemset (which is actually fill_n).
[ROCm/clr commit: 4693c5e56c]
2017-11-01 22:33:13 +00:00
Alex Voicu b738633bcb This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
[ROCm/clr commit: 28f87f7d2e]
2017-11-01 15:09:59 +00:00
Ben Sander fb169b4de6 Fix bug with peer-to-peer combined with context API
- Store context inside the tracker rather than using int deviceID that
  was always mapped to primary context
- IsPeerWatcher now based on device IDs rather than specific peers.


[ROCm/clr commit: a417241507]
2017-10-26 19:44:22 +00:00
Ben Sander 26a332fd62 Merge pull request #179 from gargrahul/fix_hipmallocarray
Fixed hipMallocArray for 1D cases

[ROCm/clr commit: b54ab82694]
2017-09-14 12:59:33 -05:00
Ben Sander 2e98e3c4a0 Add HIP_INIT_ALLOC to init allocated memory.
[ROCm/clr commit: fff42fd591]
2017-09-13 23:31:48 +00:00
Rahul Garg a4da20dc5b Fixed hipMallocArray for 1D cases
[ROCm/clr commit: baef2321c8]
2017-09-12 21:52:11 +05:30
Rahul Garg d238f5061e Null check on input pointer arguments
[ROCm/clr commit: 765d7f3c7b]
2017-08-25 08:46:34 +05:30
Maneesh Gupta d74896f873 [texture] guard new HCC APIs under workweek
Change-Id: I4f60a64fb0b0496ca1eb01ffe6ddda121c25d976


[ROCm/clr commit: 172a568aa6]
2017-08-15 15:51:38 +05:30
Weixing Zhang a7f95bb8ee [HIP Texture] The GPU virtual address for texture memory needs to be
aligned.

In hcc_am, a bigger buffer will be allocated for alignment purpose
and _unalignedDevicePointer is added in struct AmPointerInfo for
original allocated address.


[ROCm/clr commit: e4de2d1138]
2017-08-08 11:18:00 -04:00
Rahul Garg 5a1578847e fix hipMemcpy2DAsync
[ROCm/clr commit: 320ae86d44]
2017-07-29 06:50:56 +05:30
Maneesh Gupta 97edbda54d Merge pull request #116 from bensander/enable_coh_host
Make host memory allocations coherent by default.

[ROCm/clr commit: 9086c14936]
2017-07-27 10:45:32 +05:30
Ben Sander 235b60165f Make host memory allocations coherent by default.
Associated change is to optimize event recording so it uses
agent-scope releaes (since it was only using system-scope release
to support non-coherent host mem).

Flags and environment variables exist to obtain previous behavior
if desired.  Options are documented in new performance guide.


[ROCm/clr commit: 6576201ec2]
2017-07-26 19:20:34 -05:00
Weixing Zhang d9abb032f7 HIP Texture Support
[ROCm/clr commit: ccbd3b13fc]
2017-07-17 15:16:12 -04:00
Sun, Peng 2582679911 Add support of HIP_HIDDEN_FREE_MEM, to deduct the returned available
memory from hipMemGetInfo API, measured in MB.

Change-Id: I7a8260c12e032e04e26611db4c38c893a29f2653


[ROCm/clr commit: e5ce585307]
2017-06-26 15:29:38 -05:00
Rahul Garg 389f1d6aa8 Validity check of input arguments in Ipc Mem APIs
Change-Id: Ia48e949d19f354f10c7e44cc2457fd4154bf6d76


[ROCm/clr commit: 85708089d1]
2017-06-14 15:18:57 +05:30
Ben Sander 2408d0cf79 Use amHostCoherentFlag. Requires new HCC version.
[ROCm/clr commit: 9bfc7b0e13]
2017-06-07 09:06:40 -05:00
Ben Sander d302498787 Add hipHostMallocCoherent, hipHostMallocNonCoherent
Provide per-allocation control over coherent/non-coherent mem.
These overrid the default HIP_COHERENT_HOST_ALLOC setting.


[ROCm/clr commit: dda70ae514]
2017-05-24 00:48:10 -05:00
Ben Sander ae983e1b09 Remove HIP_MAX_QUEUES (replaced with HCC_MAX_QUEUES)
[ROCm/clr commit: d43d57d39c]
2017-05-23 23:48:01 -05:00
Ben Sander 0cde8e5db4 Fix trace category for hipHostMalloc
[ROCm/clr commit: ca07615c37]
2017-05-23 23:15:45 -05:00
Ben Sander 8c50285d30 Return precise address for hipHostGetDevicePointer.
[ROCm/clr commit: ee37a31799]
2017-05-17 07:36:06 -05:00
Ben Sander 4ac6ac9d1d 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/clr commit: 8bc6ee5932]
2017-05-16 19:04:25 -05:00
Ben Sander ee05975efa Add HIP_TRACE_API=4. Only display memory allocation/free apis.
[ROCm/clr commit: 7e7ba5027f]
2017-05-16 19:04:25 -05:00
Ben Sander 90e5930923 hipHostMalloc allocation are mapped to all devices by default.
Support hipHostMallocPortable flag.
Default flags are hipHostMallocPortable | hipHostMallocMapped.

Also:
-refactor tests to move addCount and addCountReverse into HipTest
namespace.
-test multi-GPU host memory.


[ROCm/clr commit: ff9bed6535]
2017-05-10 17:34:36 -05:00
Ben Sander fa1ac559cb Fix some typos, add additional guidance for -BSymbolic
[ROCm/clr commit: 9a026b62a8]
2017-05-05 17:29:04 -05:00
Rahul Garg 9739d5d60f Added support for hipMemcpy2DAsync in HIP/HCC
Change-Id: Ia4a8306f2dc1e33a81a7195ec29aef652fcccc4b


[ROCm/clr commit: b136e80a45]
2017-05-03 22:29:12 +05:30
Ben Sander 05c136e7b8 Fix hipMalloc to return error code if allocation fails.
[ROCm/clr commit: fb7eee01ff]
2017-04-24 22:30:54 -05:00
Aditya Atluri 8d9e22c975 fixed build issues with hipPointerGetAttributes
Change-Id: I3f5fbc05bdaef720884ba949075928752a070377


[ROCm/clr commit: 1f532b06f6]
2017-04-24 15:31:07 -05:00
Aditya Atluri 119f5a1e67 changed arguments for hipPointerGetAttributes
Change-Id: Ia7a7c4722c1f7d0a23f0e5cc3dd6dea6c01c1fd8


[ROCm/clr commit: 85c189c846]
2017-04-24 15:24:16 -05:00
Rahul Garg a14593b331 mgpu IPC support fix
Change-Id: I12e4b2fd189c3658efd3b07defa18ece3853b0eb


[ROCm/clr commit: 4906cd5f0d]
2017-04-04 15:51:10 +05:30
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
Rahul Garg 30eb97392a Fix for MemcpyFromSymbol on HIP/NVCC path
Change-Id: Ice38307f72870ae468cbf0861e104f0fa46dfd56


[ROCm/clr commit: 41f0ebebf0]
2017-03-27 00:35:10 +05:30
Rahul Garg 62c3bd7141 Fix for hipMemcpyFromSymbolAsync
Change-Id: I449c669c8f0ef041deaf0a1bc812a71b2f0cc5a6


[ROCm/clr commit: dfa516f804]
2017-03-24 10:30:33 +05:30
Rahul Garg 130545d322 Fix for hipMemcpyFromSymbol (sync)
Change-Id: I66afec5443ce904a63ced1fafece5144ca59393e


[ROCm/clr commit: e22044de36]
2017-03-21 23:48:04 +05:30
Rahul Garg 4443b7520c Added hipMemsetD8
Change-Id: I6a230a036c9c46c72a77d5f93c16ce8a00c3f837


[ROCm/clr commit: dccf9e2aa9]
2017-03-14 22:11:34 +05:30
Ben Sander 49d7ea94f5 Refactor registered memory calls.
[ROCm/clr commit: b7acb85fa8]
2017-03-11 09:18:27 -06:00
Ben Sander a0932fbcc3 Update hipHostRegister debug and pointerTracker debug and notes
[ROCm/clr commit: e43592721e]
2017-03-11 09:18:27 -06:00
Ben Sander c8595b0373 Fix copying of registered memory.
Set device properly so copying can recover context.
Enhance test to catch this case.


[ROCm/clr commit: 23a58775df]
2017-03-11 09:18:27 -06:00
Rahul Garg b2b8361763 IPC supported using ROCR APIs
Change-Id: I0a353b1240098f4b20fa266a871f5f5826290af9


[ROCm/clr commit: 3af487007b]
2017-03-10 23:45:28 +05:30
Aditya Atluri c861d10d1e Added new API, hipMemPtrGetInfo
1. This API returns memory allocation size of pointer
2. Added test to check its functionality

Change-Id: I87976d817b5a6ca5530336c09e7cb0420601cb2c


[ROCm/clr commit: 7b7d53f875]
2017-03-07 13:46:29 -06:00
Aditya Atluri 78f1d54ad6 Added initial support for hipMemcpyFromSymbol. But not working!
Change-Id: I48d8c7de4ec9f85c6c942be995fb488a3931f5d7


[ROCm/clr commit: 7ac5017cb9]
2017-02-23 11:29:06 -06:00
Aditya Atluri 945526cf77 added runtime api hipMemcpyFromSymbolAsync
Change-Id: Ibaf925faf0ba464dd0ed6c5ea74c224c2ce38889


[ROCm/clr commit: 3d348b2d81]
2017-02-22 19:16:35 -06:00
Aditya Atluri f36992067b fixed symbol memcpy issue
Change-Id: I89d7401be51d194bcbf771020ba66e3d3b6a18f8


[ROCm/clr commit: 0d4e6ae60a]
2017-02-01 17:54:59 -06:00