2016-01-26 20:14:33 -06:00
|
|
|
# bit_extract
|
|
|
|
|
|
2020-12-15 17:38:08 -05:00
|
|
|
Show an application written directly in HIP which uses platform-specific check on __HIP_PLATFORM_AMD__ to enable use of
|
2023-08-14 12:06:14 +05:30
|
|
|
an instruction that only exists on the AMD platform.
|
2016-01-27 00:23:47 -06:00
|
|
|
|
|
|
|
|
See related [blog](http://gpuopen.com/platform-aware-coding-inside-hip/) demonstrating platform specialization.
|
2023-12-11 03:43:30 +00:00
|
|
|
|
|
|
|
|
- Steps to build this sample:
|
|
|
|
|
```
|
|
|
|
|
$ mkdir build; cd build
|
|
|
|
|
$ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm
|
|
|
|
|
$ make
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Execute File
|
|
|
|
|
```
|
|
|
|
|
$ ./bit_extract
|
|
|
|
|
|
|
|
|
|
pch size: 11743288
|
|
|
|
|
__hipGetPCH succeeded!
|
|
|
|
|
info: running on device #0
|
|
|
|
|
info: allocate host mem ( 7.63 MB)
|
|
|
|
|
info: allocate device mem ( 7.63 MB)
|
|
|
|
|
info: copy Host2Device
|
|
|
|
|
info: launch 'bit_extract_kernel'
|
|
|
|
|
info: copy Device2Host
|
|
|
|
|
info: check result
|
|
|
|
|
PASSED!
|
|
|
|
|
```
|