Michael LIAO
498fe92734
[hip] Minor fix to silence compilation warnings.
...
- Add parenthese to silence repeative compilation warnings across
projects built against hip.
2019-06-04 10:39:31 -04:00
Aaron Enye Shi
ff74babedf
Fix bug in __smid not setting correct size
...
The SZ field should minus by 1 since SIZE range is 1..32. Also add comments that results may vary.
2019-05-22 19:20:09 +00:00
Maneesh Gupta
117bdd8774
Merge pull request #1062 from mhbliao/hliao/master/icmp
...
[hip] Re-implement ballot using AMDGCN builtins
2019-05-03 17:48:19 +05:30
Michael LIAO
9bd2d5746d
[Device Function] Fix implementation of __bitinsert_u64
...
- It's a common mistake by assuming 1 << shamt would be promoted to
64-bit, if shamt is a 64-bit integer. That's not the case. Replace
that left shift to a 64-bit one to ensure it won't fall into undefined
behavior.
- Fix the host-side implementation as well for device function testing.
2019-04-30 08:59:13 -04:00
Michael LIAO
a64637da2c
[devfunc] Re-implement ballot using AMDGCN builtins
...
- As the signature of `amdgcn.icmp` is changed for next-gen chip, using
clang builtins is portable way to hide that details.
2019-04-29 17:21:25 -04:00
Konstantin Pyzhov
beadaab661
Fix for __popcll() device function implementation.
2019-04-19 08:53:22 -04:00
Konstantin Pyzhov
b7bd29924a
Fix for __ffsll() device functions.
2019-04-18 13:07:24 -04:00
Michael LIAO
939d153c1a
SWDEV-184380 Fix hcc compilation
...
- `hcc` has no builtin. Need to invoke LLVM intrinsic directly.
2019-03-26 15:20:17 -04:00
Michael LIAO
e51fa174c8
[Device Function] Fix typos.
2019-03-19 15:32:19 -04:00
Michael LIAO
950b6efe72
[Device Function] Support immediate argument.
...
- `immarg`, immediate argument, is enabled on all AMDGPU intrinsics.
Revise device functions using these intrinsics with immediate
arguments.
2019-03-15 12:38:04 -04:00
Maneesh Gupta
0b86b421c1
Merge pull request #714 from aaronenyeshi/remove-static-hip-device
...
Remove libhip_device.a static library
2018-10-31 14:08:29 +05:30
Aaron Enye Shi
817b27d530
Remove libhip_device.a static library
...
Move remaining function definitions from device_util.cpp to hip_runtime.h header. We can now remove the static library completely as device_util.cpp was the last file part of target hip::hip_device .
2018-10-25 19:52:35 +00:00
Maneesh Gupta
f6f160fa6b
Merge pull request #723 from mangupta/fix_double_shfl
...
Fix logic for double variants of __shfl*
2018-10-25 06:01:38 +05:30
Maneesh Gupta
19404e603d
Fix logic for double variants of __shfl*
...
Change-Id: I604f00b54cf4bd9c5f26ca6fa680fca5e9629417
2018-10-24 12:39:09 +05:30
Maneesh Gupta
0703a2d0f0
Make HIP functional again with HCC from ROCm 1.9.x
...
Change-Id: I214acdfd0b79dcf783993e44fe31baee64fd4dc3
2018-10-24 10:41:56 +05:30
Aaron Enye Shi
0787f74ac2
Replace IRIF fences with atomic_work_item_fence
2018-10-04 21:47:28 +00:00
Yaxun Sam Liu
cf184460e9
Fix build failure of hipTestHalf and hipTestIncludeMath for hip-clang
2018-09-18 21:00:15 -04:00
Maneesh Gupta
66f863d1f3
Merge branch 'master' into support-malloc
2018-09-17 10:17:25 +05:30
carlushuang
d577f27d1a
fix __longlong_as_double() problem, return the double value
...
previous version return a long long valus *as* double, hence we may get the wrong result.
this also affect atomicAdd(double * ...), which use long long pointer to mimic double pointer.
Signed-off-by: carlushuang <carlus.huang@amd.com >
2018-09-12 13:25:00 +08:00
Maneesh Gupta
a3a93a68d4
Merge pull request #657 from yxsamliu/fix-clz
...
Fix ambiguity of __clz and __clzll
2018-09-03 16:34:42 +05:30
Maneesh Gupta
7459defec1
Merge pull request #651 from yxsamliu/hip-clang-clock
...
Add clock() and clock64()
2018-09-03 16:32:30 +05:30
Yaxun Sam Liu
11c91c2fdd
Fix ambiguity of __clz and __clzll
2018-08-31 18:07:57 -04:00
Yaxun Sam Liu
1f74a66bea
Add clock() and clock64()
2018-08-29 10:51:00 -04:00
Aaron Enye Shi
ba9fc6f355
Add bitinsert64 to device functions
2018-08-28 20:01:14 +00:00
Aaron Enye Shi
b939a3c6ed
Clean up and add meaningful variables to bit funcs
2018-08-28 18:19:48 +00:00
Aaron Enye Shi
b445e45007
Add bitextract and bitinsert functions
2018-08-20 16:46:12 +00:00
Yaxun Sam Liu
02d0e93601
Support malloc/free for hip-clang
2018-07-27 16:24:51 -04:00
Brian Sumner
71f96388ed
Drop use of NVCC_COMPAT since it is always set
2018-07-27 09:29:29 -07:00
Maneesh Gupta
b5cfa773ef
Merge branch 'master' into move-memcpy
2018-07-17 10:51:42 +05:30
Maneesh Gupta
fb5199dee6
Merge branch 'master' into feature_native_vector_types
...
Change-Id: I943b94ee230871a960d8f9c321ad5e096183b415
2018-07-17 09:51:22 +05:30
Yaxun (Sam) Liu
e22c35e124
Include stddef.h in device_functions.h and remove use of uint8_t
2018-07-10 18:12:41 -04:00
Yaxun (Sam) Liu
8136a348ab
Move __hip_hc_memcpy and __hip_hc_memset from device_utils.cpp to device_functions.h as inline functions
2018-07-10 18:12:41 -04:00
Aaron Enye Shi
4a7ad93655
Fix min/max, icmp asm and add comment for conversion functions
2018-07-10 18:56:48 +00:00
Aaron Enye Shi
d1323f4f9b
Remove activelanemask asm using ockl and llvm instrinsics
...
Replace implementation of __any and __all functions using OCKL functions and replaced __ballot implementation to use llvm intrinsic llvm.amdgcn.icmp.i32 instead of calls to __activelanemask_v4_b64_b1 which is not convergent.
2018-07-10 17:56:57 +00:00
Yaxun (Sam) Liu
5ec7973a6f
Add workaround __local_to_generic
2018-07-09 17:56:33 +00:00
Yaxun (Sam) Liu
e0390ddc9f
Add declare of __get_dynamicgroupbaseptr for host compilation
2018-07-09 17:56:25 +00:00
Aaron Enye Shi
930a16bccd
Implement Memory Fence Functions in header
...
Enabled __llvm_fence_* functions for seq_cst.
2018-07-04 23:35:24 +00:00
Aaron Enye Shi
07de5cb334
Workaround cast warning of smaller integer type for __to_local
...
For now, guard the __to_local function for device compile only since a local pointer should be same size as unsigned int on GPU compile. Also change to void* instead of char*.
2018-07-04 20:52:55 +00:00
Aaron Enye Shi
9ac31e0bb6
Implement __shfl_* funcs into HIP headers
2018-06-26 18:32:11 +00:00
Aaron Enye Shi
8ac864c2e3
Replace __hip_hc_ir_ inline asm with __ockl_* functions
2018-06-20 20:40:14 +00:00
Aaron Enye Shi
6dc16bbf04
Implement __ballot, __any, __all into HIP headers
2018-06-20 17:39:39 +00:00
Aaron Enye Shi
2142eb4d12
Implement hip_hc.ll into HIP headers
...
Move all __hip_hc_ir_* functions from hip_hc.ll into HIP header as inline asm. Remove hip_hc.ll and build dependencies from HIP.
2018-06-20 17:39:31 +00:00
Aaron Enye Shi
e02fc7e680
Implement device_functions.cpp into HIP headers
...
Move all Integer Intrinsics, device_functions.cpp definitions and HIP specific device functions into HIP headers. Implement the device functions using llvm_intrinsics and device-libs functions instead of calling hc::__* functions. Remove device_functions.cpp since everything is now defined in header.
2018-06-20 17:39:23 +00:00
Aaron Enye Shi
fe4e6c53fc
Move hipclang funcs into corresponding headers
2018-06-20 17:39:15 +00:00
Maneesh Gupta
946c8da88a
Merge pull request #490 from ROCm-Developer-Tools/feature_decouple_atomics_from_hc
...
Switch the atomic implementation to use Clang builtins.
2018-06-20 14:16:43 +05:30
Alex Voicu
089ab3b947
Switch the atomic implementation to use Clang builtins.
2018-06-02 12:27:17 +01:00
Alex Voicu
ab4b2a650b
Re-sync with upstream. Add integer abs.
2018-05-31 16:38:00 +01:00
Alex Voicu
59db16fd36
Switch to using ROCDL directly, as opposed to via HC. Add missing bits.
2018-05-31 03:17:26 +01:00
Siu Chi Chan
b285145966
add intrinsics mbcnt_lo, mbcnt_hi, lane_id
2018-05-08 13:43:53 -04:00
Laurent Morichetti
211c18e674
Add missing __device__ function attributes.
2018-04-11 09:29:37 -07:00