Commit Graph

62 Commits

Author SHA1 Message Date
Evgeny Mankov 1a183a71a5 [HIPIFY] cudaMallocPitch -> hipMallocPitch
[ROCm/hip commit: 12d8c53c90]
2017-05-16 18:21:25 +03:00
Evgeny Mankov 6b76c979ce [HIPIFY] CUDA Driver API: Primary Context Management support.
[ROCm/hip commit: a97cb6810c]
2017-05-15 15:35:52 +03:00
Evgeny Mankov 3408458f9f [HIPIFY] Fix string routines.
Some Clang tooling functions return std::string, some return StringRef. Assigning of returning std::string to StringRef variables leads to garbage in it.
DEBUG build is always affected.


[ROCm/hip commit: 25d470c380]
2017-05-11 21:50:36 +03:00
Evgeny Mankov dfbc039ebb [HIPIFY] LLVM 3.9 support
3.8 and 3.9 are both supported. 3.8 is stable, 3.9 needs more testing.


[ROCm/hip commit: 05be936fd6]
2017-05-05 21:28:02 +03:00
Evgeny Mankov 869dfcd01f [HIPIFY] CUDA RT memcpy functions update.
cudaMemcpyFromSymbol -> hipMemcpyFromSymbol
cudaMemcpyFromSymbolAsync -> hipMemcpyFromSymbolAsync
cudaMemcpy2DAsync -> hipMemcpy2DAsync


[ROCm/hip commit: 9b65358c68]
2017-05-03 23:05:44 +03:00
Evgeny Mankov 4841eb2bff [HIPIFY] Blas update: add a few functions, supported by HIP.
cublasDaxpy -> hipblasDaxpy
cublasDgemv -> hipblasDgemv
cublasDger  -> hipblasDger
cublasDgemm -> hipblasDgemm
cublasDgemmBatched -> hipblasDgemmBatched
cublasGetStream -> hipblasGetStream
cublasSetStream -> hipblasSetStream
cublasDaxpy -> hipblasDaxpy


[ROCm/hip commit: 1269897606]
2017-05-03 22:45:56 +03:00
Evgeny Mankov 115709ba28 [HIPIFY] HIPIFY and HIP sync with CUDA Driver API data types.
+ Update CUDA_Driver_API_functions_supported_by_HIP.md.
+ Final update of HIPIFY with CUDA driver data types.

[TODO] Syncing HIPIFY and HIP by CUDA Driver API functions.


[ROCm/hip commit: 70c94d7b83]
2017-05-03 21:59:48 +03:00
Evgeny Mankov d439bbd746 [HIPIFY] Rename enumConstantDecl -> enumDecl
Reason: not to mix up with clang's enumConstantDecl, used for enum DeclRefExpr (enum constant).


[ROCm/hip commit: c7958cbb8b]
2017-04-28 21:59:33 +03:00
Evgeny Mankov a83172c49b * [HIPIFY] [FIX] Replacement error: enum cudaMemcpyKind kind -> hipMemcpyKindyKind kind
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/72

[Solution] [Workaround]
Offset calculation for enum VarDecl as param decl, declared with enum type specifier.

[Result]
enum cudaMemcpyKind kind -> enum hipMemcpyKind kind

[ToDo]
Test on terminal qualifiers (const, etc).


[ROCm/hip commit: eddd021996]
2017-04-28 21:45:36 +03:00
Evgeny Mankov 4fe32b302f [HIPIFY] [FIX] replacement error: cudaError_t -> hipError_t_t
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/71

[Solution]
getUnqualifiedType for enumConstantDecl's type is added, except ordinary enum declarations (w/o typedef).

[ToDo]
Find more appropriate way of distinguishing redefined enum declarations and ordinary ones.


[ROCm/hip commit: 3d88932c8d]
2017-04-28 21:03:03 +03:00
Evgeny Mankov 22ccefce80 [HIPIFY] [DOC] Readme.md update: Ubuntu 16.04 support
[ROCm/hip commit: 080dd2e0d3]
2017-04-22 01:01:31 +03:00
Evgeny Mankov d4c04914d2 [HIPIFY] Initial sync HIPIFY with HIP by CUDA Driver API data types.
+ Introduce CUDA_Driver_API_functions_supported_by_HIP.md.
+ Initial update of HIPIFY with CUDA driver data types.
+ Initial sync HIP types against CUDA Driver and Runtime API types.
+ Typo fixes.


[ROCm/hip commit: 3c1dd246d6]
2017-04-21 21:46:30 +03:00
Evgeny Mankov b203f9f593 [HIPIFY] GGL support
+ hipLaunchKernel -> hipLaunchKernelGGL
+ macro HIP_KERNEL_NAME is no longer used


[ROCm/hip commit: 143e0af716]
2017-04-03 22:05:01 +03:00
Evgeny Mankov cdf0813551 [HIPIFY] Remove hipLaunchParm in HIP kernel declaration.
[ROCm/hip commit: 449d21b3c6]
2017-04-03 20:32:50 +03:00
Evgeny Mankov c539990ee5 [HIPIFY] Switch building from gcc to clang 3.8.
[ROCm/hip commit: 116a5de98e]
2017-03-21 21:01:05 +03:00
Evgeny Mankov e4c4da05fd [HIP] [FIX] Fix GCC build.
[ROCm/hip commit: e34e5ef885]
2017-03-20 21:03:18 +03:00
Evgeny Mankov 5c0ec42554 [HIPIFY] Sync HIPIFY with HIP by enum values.
+ all Cuda 7.5 RT API enum values are synced.
+ a few missing functions are added.
+ CONV_EXEC type is added for Execution control functions and data types.


[ROCm/hip commit: 749803c849]
2017-03-03 21:59:05 +03:00
Evgeny Mankov d52c918b47 [HIPIFY] sync with HIP by HIP_UNSUPPORTED Runtime functions.
[ROCm/hip commit: 6e611aa574]
2017-02-20 21:19:34 +03:00
Evgeny Mankov 091d377ce5 [HIPIFY] Sync HIPIFY with HIP by data types.
[ROCm/hip commit: 0cbe335c8f]
2017-02-20 18:28:59 +03:00
Evgeny Mankov 3c7eb4ba4e [HIPIFY] Add more Stream and Occupancy functions.
[ROCm/hip commit: dc8e8caf41]
2017-02-17 15:04:15 +03:00
Evgeny Mankov 451704189e [HIPIFY] Add missing Memcpy functions.
+ cudaChooseDevice


[ROCm/hip commit: 3b6990c8d6]
2017-02-16 23:03:01 +03:00
Evgeny Mankov 4883e82185 [HIPIFY] Add more Memory Management functions
[ROCm/hip commit: 7b44dbbe37]
2017-02-16 21:26:44 +03:00
Evgeny Mankov e97beff540 [HIPIFY] Add Channel (Textures) support.
[ROCm/hip commit: b135b24200]
2017-02-16 21:10:10 +03:00
Evgeny Mankov 07ffedbbf3 [HIPIFY] Add Inter-Process Communications (IPC) support.
[ROCm/hip commit: ea95f3166a]
2017-02-16 20:24:53 +03:00
Evgeny Mankov 2951f80caf [HIPIFY] Add CUDA Driver LAUNCH_PARAM defines.
[ROCm/hip commit: bbbe5814c1]
2017-02-16 20:00:36 +03:00
Evgeny Mankov c98017e483 [HIPIFY] Add safe type check for cudaChooseDevice matcher.
[ROCm/hip commit: 93c1e31b36]
2017-02-16 19:38:35 +03:00
Evgeny Mankov 6f5ad4e7e6 [HIPIFY] [Fix] Crash on thrust example fallback_allocator.cu.
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/65

[Bug]
Access violation in cudaStructVar matcher.

      StringRef name = structVar->getType()
        ->getAsStructureType()
        ->getDecl() // <--- Access Violation
        ->getNameAsString();

[Solution]
Add isStructureType() check before getting type as Struct.

[ToDo]
Find case-studies for that StructVar matcher with types other than Struct.


[ROCm/hip commit: 950434f4af]
2017-02-15 19:48:31 +03:00
Evgeny Mankov 8a8a7bc843 [HIPIFY] Add file:line:col info to [HIPIFY] warnings/errors.
[ROCm/hip commit: e39ed24a50]
2017-02-14 21:36:49 +03:00
Evgeny Mankov ffedb9388f [HIPIFY] Add more unhandled refs for opaque pointers.
CUfunc_st -> hipFunction_t *
CUctx_st -> hipCtx_t *
CUmod_st -> hipModule_t *


[ROCm/hip commit: b3941dd546]
2017-02-14 17:34:10 +03:00
Evgeny Mankov f6483f36a1 [HIPIFY] Fix warnings on unhandled refs.
CUstream_st -> hipStream_t *
CUevent_st -> hipEvent_t * (fixed, was -> hipEvent_t)

Warning:
[HIPIFY] warning: the following reference is not handled: 'CUstream_st' [struct var ptr]. (thrust/examples/cuda/async_reduce.cu)


[ROCm/hip commit: a6db38c337]
2017-02-14 17:23:09 +03:00
Evgeny Mankov af7455bd64 [HIPIFY] Narrow cudaKernelCallExpr matcher.
[Explanation]
Narrow cudaKernelCallExpr matcher to isExpansionInMainFile() - to the file being actually converted (without system includes).
But as for Thrust, there are *.inl files, which are nevertheless being expanded in main file.
These files contain cuda kernel launches, which are not converted successfully by hipify, for instance:
thrust/system/cuda/detail/detail/launch_closure.inl:98:23.

[ToDo]
File a bug on cudaKernelCallExpr matcher for conversion error (thrust\examples\cuda\<any cu example>).


[ROCm/hip commit: d1cfcf55f1]
2017-02-14 16:28:05 +03:00
Evgeny Mankov 31dfd8bb1f [HIPIFY] Minor refactoring
+ insertHipHeaders function is added to Cuda2Hip class;
+ fix replacement ending for hip header.


[ROCm/hip commit: c3ab4d5c5e]
2017-02-13 18:13:49 +03:00
Evgeny Mankov e09697c1cf [HIPIFY] 'CHANGED LOC', 'TOTAL LOC' and 'CODE CHANGED (in lines)' are added to statistics.
[ROCm/hip commit: 751db030c2]
2017-02-10 22:02:41 +03:00
Evgeny Mankov dbd5346cff [HIPIFY] Readme.md update.
[ROCm/hip commit: 9ba480037a]
2017-02-08 19:50:05 +03:00
Evgeny Mankov 655045d722 [HIPIFY] Readme.md update.
+ Launching example.
+ Delimiter "--" is strongly recommended.
+ "-x cuda" option is mentioned as well.


[ROCm/hip commit: 841510481e]
2017-02-08 19:43:32 +03:00
Evgeny Mankov a3cd9893d3 [HIPIFY] Formatting, no functional changes.
[ROCm/hip commit: b7992fa252]
2017-01-13 14:59:15 +03:00
Evgeny Mankov 8e219d3624 [HIPIFY] cudaDataType_t and libraryPropertyType_t support (CUDA 8.0.44 only)
All are marked as HIP_UNSUPPORTED.
IMPORTANT:
1. libraryPropertyType_t has no cuda prefix. => TO_DO: new matcher is needed.
2. all libraries (cublas, cufft, cusolver, cusparse, nvgraph) have started to use these types (since 8.0).


[ROCm/hip commit: 9a0780001b]
2017-01-10 20:24:27 +03:00
Evgeny Mankov 6c943240be [HIPIFY] cudaDeviceAttr (RT API) support up to CUDA 8.0.44
Attributes, which are not yet supported by HIP, are marked as HIP_UNSUPPORTED.


[ROCm/hip commit: 3a99536ed5]
2017-01-10 19:29:33 +03:00
Evgeny Mankov 96640b45e2 [HIPIFY] CUdevice_attribute support up to CUDA 8.0.44
Attributes, which are not yet supported by HIP, are marked as HIP_UNSUPPORTED.


[ROCm/hip commit: 7ed2b163de]
2017-01-10 17:54:22 +03:00
Evgeny Mankov 688d9f459e [HIPIFY] Elapsed time is added to statistics.
[ROCm/hip commit: 14e9cf7e62]
2016-12-28 20:44:05 +03:00
Evgeny Mankov 9d41561ab4 [HIPIFY] Added the rest of cuBlas API.
CUBLAS API 7.5 now is supported by hipify;
API calls, which are not yet supported by hcblas/hipblas, are listed as HIP_UNSUPPORTED.


[ROCm/hip commit: 6ceb85a03a]
2016-12-28 18:08:10 +03:00
Evgeny Mankov 2250218e10 [HIPIFY] Formatting, no functional changes.
[ROCm/hip commit: d7d3fcc77d]
2016-12-27 19:48:59 +03:00
Evgeny Mankov 12bf2e3f73 [HIPIFY] [Fix] An argument of a function used as macro argument is not hipified.
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/35


[ROCm/hip commit: 5ec0488ce8]
2016-12-27 18:54:02 +03:00
Evgeny Mankov 154576f772 [HIPIFY] Pointer to typedef declaration is not hipified
Fix for https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/60


[ROCm/hip commit: 24703944de]
2016-12-26 19:03:50 +03:00
Evgeny Mankov d2cf5ba147 [HIPIFY] Fix line endings.
[ROCm/hip commit: ab00e2a627]
2016-12-23 18:01:26 +03:00
Evgeny Mankov d152a89e79 [HIPIFY] Stats: Calculation of changed code amount, based on actually replaced bytes.
+ REPLACED bytes, TOTAL bytes & CODE CHANGED are added to statistics.
+ -o-stats option for specifying the file with statistic.


[ROCm/hip commit: 6882057fd2]
2016-12-23 17:40:06 +03:00
Evgeny Mankov 0215c67ba6 [HIPIFY] Statistics in CSV file.
+ Stats by CUDA ref name.
+ Conversion %.

TODO: Calculation of changed code amount, based on actually replaced bytes.


[ROCm/hip commit: 4bb8bf8dab]
2016-12-21 23:08:01 +03:00
Evgeny Mankov 121b909f55 [HIPIFY] Reflect unsupported CUDA API refs in statistics
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/53

+ Unsupported refs (by HIP) are now might be listed along with the supported ones.
+ Warnings are added for the unhandled (by HIPIFY) refs, for instance:
  "warning: the following reference is not handled: 'cublasContext' [param decl ptr]."
+ Reflect unsupported CUDA API refs in statistics.
+ Occupancy API [HIP_UNSUPPORTED].
+ A few CUBLAS refs are listed as HIP_UNSUPPORTED.

TODO: Statistics in CSV file.


[ROCm/hip commit: 3dd32e969d]
2016-12-19 14:38:19 +03:00
Evgeny Mankov e29cc18289 [HIPIFY] nested macro is not hipified, when it isAnyIdentifier
Fix for https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/55


[ROCm/hip commit: 2383d9bc1a]
2016-12-15 21:00:34 +03:00
Evgeny Mankov 4fd6a82aaf [HIPIFY] Code refactoring and total stat collecting
+ Single base class for Preprocessor and MatchFinder classes.
+ Total Stats for multiple files is added.


[ROCm/hip commit: ad3ec15d85]
2016-12-13 18:01:08 +03:00