Grafico dei commit

120 Commit

Autore SHA1 Messaggio Data
Evgeny Mankov 17fd872099 [HIPIFY][tests] Rename the ambiguous call as well
[ROCm/hip commit: 70c5072302]
2019-10-25 16:07:31 +03:00
Evgeny Mankov 536376b341 [HIPIFY][tests] Fix ambiguous call to cusparseGetErrorString declared in cusparse.h
[ROCm/hip commit: 0410d5dcd2]
2019-10-25 16:04:20 +03:00
Evgeny Mankov d39793f0f7 [HIPIFY] Disable delayed template parsing
By implicit unconditional passing -fno-delayed-template-parsing option (which appeared in LLVM 3.8.0, thus doesn't need compatibility wrapping) to hipify-clang.

[Reason] To parse uncalled template functions otherwise they are not parsed without calling, thus not hipified.

Affects cub_03.cu test, which has uncalled global template function.


[ROCm/hip commit: b6e6f12b54]
2019-10-22 19:07:37 +03:00
Evgeny Mankov 9822351686 [HIPIFY][#1569] Fix
[ROCm/hip commit: 6f88c81a78]
2019-10-22 11:08:37 +03:00
Evgeny Mankov a9b05f246b [HIPIFY][tests] Set max clang's CudaArch for corresponding CUDA major.minor version
[Reason] To support maximum CUDA features in offline tests

+ Add defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 600 restriction for atomicAdd on doubles in atomics.cu.
  So if LLVM < 7 and --cuda-gpu-arch doesn't work, __CUDA_ARCH__ is unset too (350 by default in clang);
  if LLVM >= 7 --cuda-gpu-arch is used and __CUDA_ARCH__ is set based on it.


[ROCm/hip commit: 39e7d213cf]
2019-10-21 17:50:00 +03:00
Evgeny Mankov f345ec8c58 [HIPIFY][tests] Set max clang's CudaArch for corresponding CUDA version
[Reason] To support maximum CUDA features in offline tests

+ Add CUDA_VERSION >= 800 restriction for atomics.cu

[TODO] Find a way to use or exclude atomicAdd for doubles if LLVM < 7, because
LLVM 6.0.1 and older do not use --cuda-gpu-arch in clang's Driver code at all (option is only declared)


[ROCm/hip commit: 14b4df126c]
2019-10-21 15:51:25 +03:00
Evgeny Mankov 57b2e130e0 [HIPIFY][tests] Set -I for CUDA path instead of --cuda-path for LLVM < 4
[ROCm/hip commit: 6cfea9b600]
2019-10-20 20:08:56 +03:00
Evgeny Mankov 9ec744aaae [HIPIFY][tests] Exclude all CUB tests if CUDA_CUB_ROOT_DIR is not set
[ROCm/hip commit: ccb075b1db]
2019-10-20 20:03:18 +03:00
Evgeny Mankov 376037abfc [HIPIFY][tests] Test clean-up
[ROCm/hip commit: 82adc93e69]
2019-10-18 18:55:52 +03:00
Evgeny Mankov 55e2ef4c7a [HIPIFY][CUB][#1460] Add "using namespace cub" translation support
+ Add cub_03.cu


[ROCm/hip commit: 98874c0e7f]
2019-10-18 18:51:40 +03:00
Evgeny Mankov 60c5f0a6c7 [HIPIFY][CUB][#1460] Add cub:: namespace support in TemplateInstantiation of cudaLaunchKernel
+ Update cub_02.cu test accordingly


[ROCm/hip commit: edfd05a86d]
2019-10-16 19:02:13 +03:00
Evgeny Mankov dcbe9432bd [HIPIFY][CUB][#1460] Implement cubFunctionTemplateDecl matcher
+ Add cub_02.cu test
+ Partial fixes #1460


[ROCm/hip commit: 6960574850]
2019-10-16 13:08:11 +03:00
Evgeny Mankov 44ca50dfd0 [HIPIFY][tests] Exclude tests for the libs, which are not defined in cmake command line
+ affects cuDNN and CUB tests, paths to libraries of which are defined by CUDA_DNN_ROOT_DIR and CUDA_CUB_ROOT_DIR
+ Warn about excluding and why, for instance:
  "WARN: cuDNN tests are excluded due to unset CUDA_DNN_ROOT_DIR"


[ROCm/hip commit: 3444834e3a]
2019-10-15 14:20:23 +03:00
Evgeny Mankov d174cad0aa [HIPIFY][CUB] Add missing unit test
[ROCm/hip commit: 92fb5a3a94]
2019-10-14 12:03:20 +03:00
Evgeny Mankov 3deccebb07 [HIPIFY][CUB] Initial support (hipify-clang only)
+ Add one matcher (will be more)
+ Update Maps and Statistics
+ Add cub_01.cu unit test
+ Update lit harness to support standalone CUB
+ Update README.md
+ Update hipify-perl (only CUB header is supported for now)

[IMPORTANT]
clang (and hipify-clang) works correctly only with official NVLabs version on GitHub.
Compilation of CUB from official CUDA release has conflicts with THRUST.
Thus, to compile CUB sources, option "-I" should be specified to the cloned CUB from NVLAB on GitHub.


[ROCm/hip commit: 277d3b8369]
2019-10-14 11:55:55 +03:00
Evgeny Mankov b4d99584dc [HIPIFY][test] Update allocators.cu test
[ROCm/hip commit: 88cb3504ff]
2019-10-10 17:20:41 +03:00
Evgeny Mankov 69ea727e92 [HIPIFY][#1487][fix] Translate correctly kernel names prefixed with namespace
+ Modify CUDA2HIP_perl for the fix
+ Add ns_kernel_launch.cu test
+ Update hipify-perl by hipify-clang -perl


[ROCm/hip commit: 3286ffdfc0]
2019-10-08 15:58:48 +03:00
Evgeny Mankov eab4a41336 [HIPIFY] Return to wrapping with HIP_KERNEL_NAME(...) macro of a template instantiation kernel launch
[REASON]

1. hip-clang is fine with the templated kernel launch, brackets are unneeded: HIP_KERNEL_NAME(...) __VA_ARGS__
2. HCC is not, thus: HIP_KERNEL_NAME(...) (__VA_ARGS__)

[TODO] Clean-up entirely kernel name wrapping when HCC is finally obsolete.

+ Update perl generation, hipify-perl, and affected tests accordingly.


[ROCm/hip commit: 6bb9913e8a]
2019-10-02 16:01:07 +03:00
Evgeny Mankov 3652d77965 [HIPIFY][#1490][fix] Populate the list of supported device atomic functions
+ Update hipify-perl accordingly
+ Add atomics.cu test on all atomics


[ROCm/hip commit: b5f17e8ff0]
2019-10-01 13:57:46 +03:00
Evgeny Mankov ca15d193e8 [HIPIFY][#1439] Add reinterpret_cast to args of some functions
+ Perl part of [#1458]
+ Affected functions: hipFuncSetCacheConfig, hipFuncGetAttributes
+ Implement function generateHostFunctions() in hipify-clang for that purposes
+ Update hipify-perl accordingly


[ROCm/hip commit: 9d1d4b78e3]
2019-09-25 18:53:17 +03:00
Evgeny Mankov 1eff176c03 [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/hip commit: dd6a92afb7]
2019-09-24 09:44:17 +03:00
Evgeny Mankov 0504e85f02 [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/hip commit: 3722d5b4b9]
2019-09-19 19:33:42 +03:00
Evgeny Mankov 2cd2afa84b [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/hip commit: 4f59ec25fe]
2019-09-16 17:36:55 +03:00
Evgeny Mankov ba10db6fc6 [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/hip commit: 56ab105e9d]
2019-09-10 15:59:06 +03:00
Evgeny Mankov 17b734afde [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/hip commit: 6602fadc16]
2019-09-06 18:34:12 +03:00
Evgeny Mankov 8896d276fe [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/hip commit: b98330609b]
2019-09-03 16:44:20 +03:00
Evgeny Mankov a4af0f2fc1 [HIPIFY][tests] Add occupancy test
[ROCm/hip commit: 1bf6deb149]
2019-09-02 17:54:06 +03:00
Evgeny Mankov e78eb9bb47 [HIPIFY][#207][fix] Translate all preprocessor's conditional blocks
+ Start to translate preprocessor's false conditional blocks too:
  based on clang's https://reviews.llvm.org/D66597;
  available only starting from LLVM 10.0 or trunk.
+ Option -skip-excluded-preprocessor-conditional-blocks for skipping excluded conditional blocks:
  the default behavior for hipify-clang built with LLVM < 10.0;
  false by default for hipify-clang built with LLVM 10 or trunk.
+ Add 4 preprocessor unit tests, 2 of which are LLVM 10.0 only
+ Update couple of existing tests by setting -skip-excluded-preprocessor-conditional-blocks option:
  update lit testing accordingly


[ROCm/hip commit: 24be21495d]
2019-08-28 21:17:35 +03:00
Evgeny Mankov bddcbdeeb6 [HIPIFY] Add cudaMallocManaged -> hipMallocManaged
+ Add mapping for corresponding data types
+ Add a test
+ Update docs


[ROCm/hip commit: d20ae3b50a]
2019-08-13 17:56:06 +03:00
Evgeny Mankov f0789e57e6 [HIPIFY][cuRAND][#1257] Fix
+ Update CURAND_API_supported_by_HIP.md and test accordingly


[ROCm/hip commit: 3ac3b2800b]
2019-08-09 21:27:16 +03:00
Evgeny Mankov 728b2f5843 [HIPIFY][fix][#211] Taking into account include guard controlling macro
...while including HIP main header file, which is inserted now after #indef controlling macro, or after #pragma once, if it's occurred earlier.

+ Add a couple of unit tests.
ToDo: Check backward compatibility on older clang versions.


[ROCm/hip commit: 25075729f9]
2019-08-02 16:46:45 +03:00
Evgeny Mankov 96801f7b3a [HIP][HIPIFY] Split HIP_ARRAY_DESCRIPTOR struct to HIP_ARRAY_DESCRIPTOR and HIP_ARRAY3D_DESCRIPTOR
[Reason] To be compatible with CUDA [#1133]

Update HIP code, hipify-clang, tests and docs

[TODO] Add support of the corresponding functions on nvcc fallback path


[ROCm/hip commit: c7117df91b]
2019-07-11 14:58:16 +03:00
Evgeny Mankov 6ba67c4a81 [HIPIFY] Add device texture fetch functions support
+ Add a corresponding reverse engineered sample tex2dKernel with texture template


[ROCm/hip commit: c7a2b4e492]
2019-05-23 12:47:08 +03:00
Evgeny Mankov 87aa888175 [HIPIFY][tests] Add reverse engineered HIP sample "peer2peer"
+ Fix typo in sample "stream"


[ROCm/hip commit: 29d8e10112]
2019-05-20 17:16:11 +03:00
Evgeny Mankov ce28dc83e4 [HIPIFY][cuDNN] Add cudnnGetFilter4dDescriptor support
+ Update cudnn_convolution_forward test accordingly


[ROCm/hip commit: aed2affda2]
2019-05-16 16:36:23 +03:00
Evgeny Mankov 75adf32213 [HIPIFY][tests] Add reverse engineered HIP sample "stream"
+ Add additional checks for extern __shared__ due to [#1109]


[ROCm/hip commit: 64eeeca6ce]
2019-05-15 20:17:03 +03:00
Evgeny Mankov 2472ece71d [HIPIFY][fix][#1109] Do not preserve extern __shared__ for IncompleteArrayType
+ Update tests accordingly


[ROCm/hip commit: fa3dda9107]
2019-05-15 20:05:56 +03:00
Evgeny Mankov 265f9336f5 [HIPIFY][tests] Add reverse engineered HIP sample Profiler
+ Add missing cuda_profiler_api.h to hip/hip_profile.h transformation.
NOTE: HIP Profiler API is under development. This is NOT WORKING example.
TODO: Find out a way to generate HIP_SCOPED_MARKER, HIP_BEGIN_MARKER, HIP_END_MARKER, declared in hip/hip_profile.h in particular place (signatures are to obtain).


[ROCm/hip commit: d74d03aa74]
2019-05-14 16:43:44 +03:00
Evgeny Mankov 3d00f22ccc [HIPIFY][tests] Add reverse engineered HIP sample hipEvent
[ROCm/hip commit: 3bc3b61fb4]
2019-05-13 22:12:43 +03:00
emankov cac92068bc [HIPIFY][tests] Add reverse engineered HIP sample MatrixTranspose
[ROCm/hip commit: 4b861bca39]
2019-05-13 19:37:18 +03:00
emankov 1f57ee6125 [HIPIFY][tests] Add cuSPARSE CSR-BCSR-SPMV-conversions example
[ROCm/hip commit: e3082f5142]
2019-04-30 17:37:34 +03:00
Evgeny Mankov 86d68901da [HIPIFY][DNN] cudnnSetFilter4dDescriptor support
[ROCm/hip commit: 3fee0f3765]
2019-04-25 12:18:51 +03:00
Evgeny Mankov 7bbf825c74 [HIPIFY][tests] Fix typo in test for CUDA 10.x
[ROCm/hip commit: 8bca9f1d7a]
2019-04-01 19:52:08 +03:00
Evgeny Mankov 1397bf79d8 [HIPIFY][tests] Update lit testing infrastructure
+ Set -D__LP64__ in case of 64-bit hipify-clang binary
  [partial workaround for clang's bug https://bugs.llvm.org/show_bug.cgi?id=38811]

  C:/GIT/LLVM/trunk/llvm-64-release-vs2017/dist/lib/clang/9.0.0\include\__clang_cuda_device_functions.h(1609,45): error GEF7559A7: no matching function for call to 'roundf'
  __DEVICE__ long lroundf(float __a) { return roundf(__a); }

  #if defined(__LP64__)
  __DEVICE__ long lround(double __a) { return llround(__a); }
  __DEVICE__ long lroundf(float __a) { return llroundf(__a); } // ok: llroundf should be used when 64-bit
  #else
  __DEVICE__ long lround(double __a) { return round(__a); }
  __DEVICE__ long lroundf(float __a) { return roundf(__a); } // error
  #endif

+ Print more system info while testing in the following form:
  ========================================
  CUDA 9.0 - will be used for testing
  LLVM 9.0.0svn - will be used for testing
  AMD64 - Platform architecture
  Windows 10 - Platform OS
  64 - hipify-clang binary bitness
  32 - python 3.7.2 binary bitness
  ========================================


[ROCm/hip commit: e899ee0e06]
2019-03-06 19:26:05 +03:00
Evgeny Mankov 5f4b9a8f8f [HIPIFY][tests] caffe2 test fix
[ROCm/hip commit: 3a8ef9c8a2]
2019-02-25 17:12:32 +03:00
Evgeny Mankov 3a57fc0a4b [HIPIFY][Caffe2] Initial Caffe2 support
[ROCm/hip commit: 2619f22e5c]
2019-02-23 20:46:22 +03:00
Evgeny Mankov d91590a98b [HIPIFY][DNN] Revise and sync with CUDNN 10 and hipDNN
+ CUDNN_API_supported_by_HIP.md update
+ CUDA_Runtime_API_functions_supported_by_HIP.md update
+ libraryPropertyType_t is moved to Runtime
+ test update


[ROCm/hip commit: d26dc3cea7]
2019-02-13 19:40:59 +03:00
Evgeny Mankov 88da4a036f [HIPIFY][RAND] revise
+ add missing functions
+ add minimum rocRAND support
+ updated CURAND_API_supported_by_HIP.md


[ROCm/hip commit: 7ba8c440e6]
2019-02-08 17:54:28 +03:00
Evgeny Mankov 032cb00926 [HIPIFY][BLAS][tests] Add tests on hipifying to 'roc'
[ROCm/hip commit: 385fe36f2a]
2019-02-07 19:25:23 +03:00
Evgeny Mankov e65d1f2dc1 [HIPIFY] CUDA Runtime API functions total revise (up to CUDA 10.0)
+ for all CUDA versions starting from 7.0
+ add missing functions
+ sync with HIP
+ update CUDA_Runtime_API_functions_supported_by_HIP.md
+ update affected tests
+ fix typos
+ formatting, annotating


[ROCm/hip commit: 4ff355357f]
2019-01-24 14:05:36 +03:00