Commit Graph

3533 Commits

Author SHA1 Message Date
Evgeny Mankov 6fdfbb4062 [HIPIFY] HipifyAction refactoring
+ Merge of cudaSymbolFuncCall and cudaReinterpretCastArgFuncCall matchers into a single cudaHostFuncCall matcher
+ More const std::string declarations
+ Formatting


[ROCm/clr commit: 7c62b1b2d0]
2019-09-24 10:33:51 +03:00
Evgeny Mankov d3adb0478f [HIPIFY][#1439] Add reinterpret_cast to args of some functions
+ Affected functions: hipFuncSetCacheConfig, hipFuncGetAttributes
+ Add a corresponding Matcher cudaReinterpretCastArgFuncCall
+ Add reinterpret_cast.cu test

TODO: Do the same for hipify-perl


[ROCm/clr commit: cf467b4550]
2019-09-24 09:44:17 +03:00
Evgeny Mankov 7bdf8b4514 [HIPIFY][doc] Return X86 target back in LLVM's cmake
Due to LLVM 9.0.0 release, which still needs X86 for NVPTX, LLVM trunk - doesn't.


[ROCm/clr commit: f7b3dcd6d7]
2019-09-23 22:20:23 +03:00
Evgeny Mankov 6dfc9a99d6 [HIPIFY][perl] CUDA2HIP_Perl code cleanup
[ROCm/clr commit: a13540b97a]
2019-09-22 23:43:07 +03:00
Evgeny Mankov fa6a69e375 [HIPIFY][perl] generateSymbolFunctions() small refactoring
[ROCm/clr commit: d6b0ab0fd2]
2019-09-22 22:34:07 +03:00
Evgeny Mankov ef23cdda41 [HIPIFY][#1435][perl] Add HIP_SYMBOL wrapper to the templated Device Symbol argument of the following functions:
cudaMemcpyToSymbol, cudaMemcpyToSymbolAsync, cudaGetSymbolSize, cudaGetSymbolAddress, cudaMemcpyFromSymbol, cudaMemcpyFromSymbolAsync

+ Perl part of [#1441]
+ Implement function generateSymbolFunctions() in hipify-clang for that purposes
+ Update hipify-perl

TODO: Eliminate dim3() issue in hipify-perl as well


[ROCm/clr commit: 72a658295f]
2019-09-21 07:33:17 +03:00
Evgeny Mankov 4868880d03 [HIPIFY][doc] Update README.md due to LLVM 9.0.0 release
+ LLVM 9.0.0 is latest stable release, no patches are needed
+ The latest CUDA 10.1 Update 2 is supported
+ Tested on Windows and Linux


[ROCm/clr commit: 2a27572463]
2019-09-20 09:16:10 +03:00
Evgeny Mankov 2ee59279d6 [HIPIFY][#1435] Add HIP_SYMBOL wrapper to the templated Device Symbol argument of the following functions:
cudaMemcpyToSymbol, cudaMemcpyToSymbolAsync, cudaGetSymbolSize, cudaGetSymbolAddress, cudaMemcpyFromSymbol, cudaMemcpyFromSymbolAsync

+ Add a corresponding cudaSymbolFuncCall matcher.
+ Add device_symbols.cu test for the above 6 functions, update existed.
+ Fix dim3() type cast issue, update affected tests.

TODO: Do the same in hipify-perl


[ROCm/clr commit: d4f8c6bc4b]
2019-09-19 19:33:42 +03:00
Evgeny Mankov b6aa917b43 [HIPIFY][#1437] Fix: cudaFuncGetAttributes to hipFuncGetAttributes is supported
+ Update hipify-perl and CUDA_Runtime_API_functions_supported_by_HIP.md accordingly


[ROCm/clr commit: a49f9924a7]
2019-09-18 17:57:31 +03:00
Evgeny Mankov c2f3ca9225 [HIPIFY] Add supported device functions (from device_functions.h)
+ [perl] Sync hipify-perl accordingly


[ROCm/clr commit: 05d71d4b8b]
2019-09-18 17:07:50 +03:00
Evgeny Mankov 0c6cf5338e [HIPIFY][#1430] Build fix for LLVM < 8.0.0
[ROCm/clr commit: 774a6c5667]
2019-09-18 11:53:23 +03:00
Evgeny Mankov 3d744756a1 [HIPIFY] Add supported device functions (from math_functions.h)
+ [perl] Add generation of sub countSupportedDeviceFunctions
+ [FIX] Do not perform any replacement for supported device functions
+ [perl] Sync hipify-perl accordingly


[ROCm/clr commit: 33cd4dffd5]
2019-09-17 16:17:28 +03:00
Evgeny Mankov 3f90cba68a [HIPIFY][perl][fix] Treat ::device_function as a device function
+ Do not treat somenamespace::device_function_name as a device function
+ Fix generation of warnUnsupportedDeviceFunctions function in hipify-clang
+ Update hipify-perl based on hipify-clang -perl generation
+ Update device test math_functions.cu for hipify-perl

[Restrictions]
- hipify-perl is yet unable to handle function declarations in user namespaces
- hipify-perl is yet unable to handle using directive


[ROCm/clr commit: b43bb7d3c1]
2019-09-16 17:36:55 +03:00
Evgeny Mankov 1ab02d4279 [HIPIFY] Fix build failure due to typo in [#1377]
[ROCm/clr commit: dd752e3d4e]
2019-09-16 14:28:52 +03:00
mhbliao 3a8a65c46a [HIP] Remove a circular including. (#1418)
[ROCm/clr commit: 4691c1ef8c]
2019-09-16 08:32:47 +00:00
satyanveshd ca6b4bbc0d Fix checks in hipMemcpy[D/H]to[D/H]() (#1397)
* SWDEV-202043 hipMemcpyDtoD() issue


[ROCm/clr commit: 842e304a9c]
2019-09-16 08:32:38 +00:00
AlexBinXie cc921b35be [hip]Skip test when hipHostMallocCoherent is not supported by implementation (#1380)
[ROCm/clr commit: 313726a457]
2019-09-16 08:31:43 +00:00
ansurya 4436a38e65 Added new device attributes (#1377)
* Added new device attributes

* updated comment

* updated with new device attributes supported


[ROCm/clr commit: e2a934f377]
2019-09-16 08:31:30 +00:00
Aryan Salmanpour f68652cc5f [hip] add initial support for hipLaunchCooperativeKernelMultiDevice API (#1368)
* [hip] add initial support for hipLaunchCooperativeKernelMultiDevice API

* fix formatting


[ROCm/clr commit: 6c7da60e28]
2019-09-16 08:31:17 +00:00
Aryan Salmanpour 2596af7f32 [hip][tests] add a unit test for testing hipLaunchCooperativeKernel (#1361)
* [hip][tests] add a unit test for testing hipLaunchCooperativeKernel

* use __ockl_grid_sync function

* remove already defined __ockl_grid_sync function

* use sync function for grid synchronization


[ROCm/clr commit: 51c7fedd36]
2019-09-16 08:31:09 +00:00
Evgeny Mankov 9c4ec3eca2 [HIPIFY] Scripting related refactoring
+ Move generating hipify-perl and hipify-python into separate namespaces and files
+ Move getAbsoluteFilePath and getAbsoluteDirectoryPath to StringUtils


[ROCm/clr commit: db2fee682b]
2019-09-15 21:13:56 +03:00
Evgeny Mankov 7e629aa218 [HIPIFY][perl] Syn with hipify-clang
[ROCm/clr commit: 422403a3ff]
2019-09-15 15:25:40 +03:00
Evgeny Mankov a58504a20f [HIPIFY][perl] Generate sub warnUnsupportedDeviceFunctions
[ROCm/clr commit: b69f7afa67]
2019-09-15 15:18:58 +03:00
Evgeny Mankov c395967d40 Merge pull request #1417 from emankov/master
[HIPIFY][doc] Update README.md

[ROCm/clr commit: d05caef113]
2019-09-13 18:58:22 +03:00
Evgeny Mankov 267555caff [HIPIFY][doc] Update README.md
+ Adding -DLLVM_TARGETS_TO_BUILD="NVPTX" to LLVM's cmake command line for minimizing LLVM's build (tested)
+ Test logs update
+ Versions update


[ROCm/clr commit: 0416eaf12e]
2019-09-13 18:56:48 +03:00
Rahul Garg f79ffd587e Fix typo and colon in comment
[ROCm/clr commit: d9179cbe70]
2019-09-13 03:09:01 +05:30
Rahul Garg b7a06efb6c [HACK] Temporary fix for hipFree for hipManagedMalloc
[ROCm/clr commit: 2e9b8e9d0d]
2019-09-13 02:10:21 +05:30
Evgeny Mankov ab1bbd7eca [HIPIFY] Add unsupported fp16 functions
[ROCm/clr commit: 4b3889b47e]
2019-09-12 18:51:25 +03:00
Evgeny Mankov 76cdd624ef [HIPIFY] Add more unsupported device functions
[ROCm/clr commit: ece8a71bad]
2019-09-12 17:53:25 +03:00
Evgeny Mankov 54ba179911 [HIPIFY][#1404] Fix: add cooperative_groups.h -> hip/hip_cooperative_groups.h
[ROCm/clr commit: 905c6383db]
2019-09-11 18:07:09 +03:00
Evgeny Mankov 38c128b941 Merge pull request #1406 from emankov/master
[HIPIFY][#1400] Fix Template Instantiation kernel launch (clang & perl)

[ROCm/clr commit: ede7e2a094]
2019-09-11 15:49:46 +03:00
Evgeny Mankov 4cfb3aa7b7 [HIPIFY][#1400] Fix Template Instantiation kernel launch (clang & perl)
+ Enclose template instantiation kernel calls into round brackets, leave regular kernel names unchanged (hipify-perl doesn't handle cases with macros).
+ Fix corresponding tests.

PS. hipify-perl couldn't handle correctly the following cases due to macros expansion disability, thus hipify-clang should be used instead:

#define KERNEL_NAME_MACRO axpy<float>
#define KERNEL_CALL_MACRO axpy<float><<<1, 2>>>
#define KERNEL_ARG_LIST_MACRO a, x, y

// CUDA:
KERNEL_NAME_MACRO<<<1, 2>>>(KERNEL_ARG_LIST_MACRO);
KERNEL_CALL_MACRO(KERNEL_ARG_LIST_MACRO);

// hipify-perl:
hipLaunchKernelGGL(KERNEL_NAME_MACRO, dim3(1), dim3(2), 0, 0, KERNEL_ARG_LIST_MACRO);
KERNEL_CALL_MACRO(KERNEL_ARG_LIST_MACRO);

// hipify-clang:
hipLaunchKernelGGL((KERNEL_NAME_MACRO), dim3(1), dim3(2), 0, 0, KERNEL_ARG_LIST_MACRO);
hipLaunchKernelGGL((axpy<float>), dim3(1), dim3(2), 0, 0, KERNEL_ARG_LIST_MACRO);


[ROCm/clr commit: 4e3845be83]
2019-09-10 15:59:06 +03:00
Aditya Lad 4225ba4c8a Replacment of RENAME command in CMakeLists.txt (#1402)
[ROCm/clr commit: 4a53718e10]
2019-09-10 08:35:16 +00:00
Evgeny Mankov 755d1a9ea6 [HIPIFY] Add device functions support
+ Add a corresponding matcher cudaDeviceFuncCall to match only (__device__ or __global__) and not __host__ functions.
+ Add a corresponding device functions mapping:
  only unsupported are listed, cause supported are exactly the same as of CUDA and do not need transformation;
  make FindAndReplace for device functions separated from host API calls.
+ Add a test to distinguish device functions and user-defined.


[ROCm/clr commit: aec10d6ee1]
2019-09-06 18:34:12 +03:00
Jeff Daily 42c49b6ba9 fix bug where HIP_DB=1 seg faults at startup (#1388)
[ROCm/clr commit: 3d7c146296]
2019-09-05 10:04:19 +00:00
mhbliao b55c3dba08 [hip] Stop using noduplicate and replace it with convergent. (#1390)
[ROCm/clr commit: d511c3e363]
2019-09-05 10:03:43 +00:00
Paul Fultz II a61aaacbca Use hcc when building with hcc compiler (#1225)
* Use hcc when building with hcc compiler

* Fix misnamed variable

* Dont set HIP_RUNTIME


[ROCm/clr commit: d359cd4449]
2019-09-05 10:03:04 +00:00
Evgeny Mankov b6c6ecab67 [HIPIFY][cmake][#1394] Fix
[#1394] cmake's VERSION_GREATER_EQUAL introduced in 3.7


[ROCm/clr commit: a847247d9a]
2019-09-05 12:08:56 +03:00
Evgeny Mankov 8dfefa1f9a [HIPIFY][perl] Code cleanup (preparation for generating)
[ROCm/clr commit: f114a79462]
2019-09-05 11:52:59 +03:00
Evgeny Mankov a9d5b1e29e [HIPIFY][perl] Sync hipify-perl with hipify-clang
Sync by means of semi-automatic generation: hipify-clang -perl


[ROCm/clr commit: 0ca6525d90]
2019-09-04 17:07:45 +03:00
Evgeny Mankov 73e71db792 [HIPIFY][perl] Code cleanup and formatting
[ROCm/clr commit: 7ab9afe513]
2019-09-04 16:37:26 +03:00
Evgeny Mankov 790ab87461 [HIPIFY][perl][#259] Fix
empty<<<1, 2>>> ( );     >>  hipLaunchKernelGGL(empty, dim3(1), dim3(2), 0, 0);
empty<<<1, 2, 0>>>();    >>
empty<<<1, 2, 0, 0>>>(); >>

instead of erroneous:    >> hipLaunchKernelGGL((empty), dim3(1), dim3(2), 0, 0, );


[ROCm/clr commit: e26ec02a99]
2019-09-03 16:44:20 +03:00
Yaxun (Sam) Liu 732c9829c1 Do not include cuda wappers for OMP for hip-clang (#1382)
[ROCm/clr commit: e72346dc24]
2019-09-03 05:13:59 +00:00
Rahul Garg 33af62d66e Revert "Using HSA API for hipMemsetAsync (#1346)" (#1381)
This reverts commit 4313f00563.

[ROCm/clr commit: d433f6fb58]
2019-09-03 05:13:46 +00:00
Nicholas Malaya 85c3f035e4 Fix Broken Link in hip_porting_guide (#1376)
The math library equivalents between CUDA-HIP are broken. This is a key feature for converting to AMD hardware. This fix corrects the broken link and moves the library equivalents to sit under the "Porting a New Cuda Project" header.

[ROCm/clr commit: 796b8aafd7]
2019-09-03 05:13:35 +00:00
Sarbojit2019 e0f1719c1b Removed hipLaunchKernel macro got missed in Merge (#1374)
[ROCm/clr commit: 4d270775c8]
2019-09-03 05:13:07 +00:00
Evgeny Mankov 88a6eadbb6 [HIPIFY][doc] Update README.md (testing, versions)
[ROCm/clr commit: d9b5e2f74a]
2019-09-02 18:18:43 +03:00
Evgeny Mankov 12efe906e7 [HIPIFY][tests] Add occupancy test
[ROCm/clr commit: 608331250e]
2019-09-02 17:54:06 +03:00
Evgeny Mankov 46373a3631 [HIPIFY][fix] Fix for upcoming LLVM 10.0
[ROCm/clr commit: 8eb7d53cec]
2019-09-01 18:15:03 +03:00
Sameer Sahasrabuddhe 929b6d5f34 remove obsolete test for OCKL Asynchronous Streams
The implementation for OCKL AS was recently removed from the device
library since that feature is now superseded by hostcall.


[ROCm/clr commit: 68c133bd78]
2019-08-30 20:41:29 +05:30