Gráfico de commits

62 Commits

Autor SHA1 Mensaje Fecha
Evgeny Mankov ef86f943ac [HIPIFY] Add more CUDA Driver API 8.0.44 Data structures. 2017-05-30 17:58:13 +03:00
Evgeny Mankov a19ecab3f2 [FIX] [HIPIFY] Add matchers for function return types.
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/73

Examples (https://github.com/thrust/thrust/blob/master/thrust/system/cuda/detail/trivial_copy.inl):

template<typename System1,
         typename System2>
cudaStream_t cuda_memcpy_stream(const thrust::cpp::execution_policy<System1> &,
                                const thrust::cuda::execution_policy<System2> &exec)

template<typename System1,
         typename System2>
cudaMemcpyKind cuda_memcpy_kind(const thrust::cuda::execution_policy<System1> &,
                                const thrust::cpp::execution_policy<System2> &)
2017-05-24 18:25:40 +03:00
Evgeny Mankov 21d74f09b9 [FIX] [HIPIFY] Matcher for new operator is missing.
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/80

Example from CUDA 8.0.44 sample (CUDASamples\0_Simple\matrixMulDrv\matrixMulDrv.cpp):
    CUjit_option *jitOptions = new CUjit_option[jitNumOptions];
where CUjit_option is enum, should be:
    hipJitOption *jitOptions = new hipJitOption[jitNumOptions];
2017-05-23 19:45:38 +03:00
Evgeny Mankov 51b7420359 [HIPIFY] [FIX] [HIPIFY] Matcher for pointer to enum var declaration is missing.
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/79

Example from CUDA 8.0.44 sample (CUDASamples\0_Simple\matrixMulDrv\matrixMulDrv.cpp):
    CUjit_option *jitOptions = new CUjit_option[jitNumOptions];
where CUjit_option is enum, should be:
    hipJitOption *jitOptions = new hipJitOption[jitNumOptions];

[TODO]
1. new CUjit_option -> new hipJitOption.
   Matcher for new operator is missing:
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/79
2. Merge matchers cudaEnumDecl and cudaEnumVarPtr.
2017-05-19 17:39:09 +03:00
Evgeny Mankov ae9f14ef9c [HIP] [HIPIFY] [FIX] cuModuleLoadDataEx -> hipModuleLoadDataEx
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/81

1.	Do not use JIT options on HCC path, call hipModuleLoadData instead.
2.	NVCC path is unchanged, to call cuModuleLoadDataEx with all options.
3.	Get rid of manual hipification, based on #ifdef #else for NVCC/HIP.
4.	Update documentation accordingly.
2017-05-19 17:22:14 +03:00
Evgeny Mankov 221faeb916 [HIPIFY] cudaMallocPitch -> hipMallocPitch 2017-05-16 18:21:25 +03:00
Evgeny Mankov 181d3e2bae [HIPIFY] CUDA Driver API: Primary Context Management support. 2017-05-15 15:35:52 +03:00
Evgeny Mankov aa52b94be1 [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.
2017-05-11 21:50:36 +03:00
Evgeny Mankov 054bf0859d [HIPIFY] LLVM 3.9 support
3.8 and 3.9 are both supported. 3.8 is stable, 3.9 needs more testing.
2017-05-05 21:28:02 +03:00
Evgeny Mankov 2636d91ba4 [HIPIFY] CUDA RT memcpy functions update.
cudaMemcpyFromSymbol -> hipMemcpyFromSymbol
cudaMemcpyFromSymbolAsync -> hipMemcpyFromSymbolAsync
cudaMemcpy2DAsync -> hipMemcpy2DAsync
2017-05-03 23:05:44 +03:00
Evgeny Mankov 72df25a0c7 [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
2017-05-03 22:45:56 +03:00
Evgeny Mankov 3b40776244 [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.
2017-05-03 21:59:48 +03:00
Evgeny Mankov 3e89277a9b [HIPIFY] Rename enumConstantDecl -> enumDecl
Reason: not to mix up with clang's enumConstantDecl, used for enum DeclRefExpr (enum constant).
2017-04-28 21:59:33 +03:00
Evgeny Mankov 85a32c3987 * [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).
2017-04-28 21:45:36 +03:00
Evgeny Mankov 5f76cf3098 [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.
2017-04-28 21:03:03 +03:00
Evgeny Mankov 342c63d398 [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.
2017-04-21 21:46:30 +03:00
Evgeny Mankov 81415a41b8 [HIPIFY] GGL support
+ hipLaunchKernel -> hipLaunchKernelGGL
+ macro HIP_KERNEL_NAME is no longer used
2017-04-03 22:05:01 +03:00
Evgeny Mankov a9268008ac [HIPIFY] Remove hipLaunchParm in HIP kernel declaration. 2017-04-03 20:32:50 +03:00
Evgeny Mankov 70ed1014ad [HIP] [FIX] Fix GCC build. 2017-03-20 21:03:18 +03:00
Evgeny Mankov 4ba96241b4 [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.
2017-03-03 21:59:05 +03:00
Evgeny Mankov eae27590d7 [HIPIFY] sync with HIP by HIP_UNSUPPORTED Runtime functions. 2017-02-20 21:19:34 +03:00
Evgeny Mankov d6c01aabab [HIPIFY] Sync HIPIFY with HIP by data types. 2017-02-20 18:28:59 +03:00
Evgeny Mankov 77e97627da [HIPIFY] Add more Stream and Occupancy functions. 2017-02-17 15:04:15 +03:00
Evgeny Mankov 72a9df0250 [HIPIFY] Add missing Memcpy functions.
+ cudaChooseDevice
2017-02-16 23:03:01 +03:00
Evgeny Mankov f37343267a [HIPIFY] Add more Memory Management functions 2017-02-16 21:26:44 +03:00
Evgeny Mankov 069bb1389c [HIPIFY] Add Channel (Textures) support. 2017-02-16 21:10:10 +03:00
Evgeny Mankov fd5d8c2bb5 [HIPIFY] Add Inter-Process Communications (IPC) support. 2017-02-16 20:24:53 +03:00
Evgeny Mankov 8a2748e8de [HIPIFY] Add CUDA Driver LAUNCH_PARAM defines. 2017-02-16 20:00:36 +03:00
Evgeny Mankov d713349872 [HIPIFY] Add safe type check for cudaChooseDevice matcher. 2017-02-16 19:38:35 +03:00
Evgeny Mankov 7c1deb6140 [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.
2017-02-15 19:48:31 +03:00
Evgeny Mankov 26dc7a0995 [HIPIFY] Add file:line:col info to [HIPIFY] warnings/errors. 2017-02-14 21:36:49 +03:00
Evgeny Mankov 353f5b238a [HIPIFY] Add more unhandled refs for opaque pointers.
CUfunc_st -> hipFunction_t *
CUctx_st -> hipCtx_t *
CUmod_st -> hipModule_t *
2017-02-14 17:34:10 +03:00
Evgeny Mankov ce2daa53fb [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)
2017-02-14 17:23:09 +03:00
Evgeny Mankov afe6073d3f [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>).
2017-02-14 16:28:05 +03:00
Evgeny Mankov e5c601df45 [HIPIFY] Minor refactoring
+ insertHipHeaders function is added to Cuda2Hip class;
+ fix replacement ending for hip header.
2017-02-13 18:13:49 +03:00
Evgeny Mankov 25d4de9e95 [HIPIFY] 'CHANGED LOC', 'TOTAL LOC' and 'CODE CHANGED (in lines)' are added to statistics. 2017-02-10 22:02:41 +03:00
Evgeny Mankov 5200073b4c [HIPIFY] Formatting, no functional changes. 2017-01-13 14:59:15 +03:00
Evgeny Mankov fd0c56a767 [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).
2017-01-10 20:24:27 +03:00
Evgeny Mankov 81fd34f236 [HIPIFY] cudaDeviceAttr (RT API) support up to CUDA 8.0.44
Attributes, which are not yet supported by HIP, are marked as HIP_UNSUPPORTED.
2017-01-10 19:29:33 +03:00
Evgeny Mankov c0c04f34be [HIPIFY] CUdevice_attribute support up to CUDA 8.0.44
Attributes, which are not yet supported by HIP, are marked as HIP_UNSUPPORTED.
2017-01-10 17:54:22 +03:00
Evgeny Mankov bbb75fdd8e [HIPIFY] Elapsed time is added to statistics. 2016-12-28 20:44:05 +03:00
Evgeny Mankov ddf51d382c [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.
2016-12-28 18:08:10 +03:00
Evgeny Mankov 9070d55814 [HIPIFY] Formatting, no functional changes. 2016-12-27 19:48:59 +03:00
Evgeny Mankov e740d368d9 [HIPIFY] [Fix] An argument of a function used as macro argument is not hipified.
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/35
2016-12-27 18:54:02 +03:00
Evgeny Mankov 3cd1adcb24 [HIPIFY] Pointer to typedef declaration is not hipified
Fix for https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/60
2016-12-26 19:03:50 +03:00
Evgeny Mankov e8c5906062 [HIPIFY] Fix line endings. 2016-12-23 18:01:26 +03:00
Evgeny Mankov 52b3fb9f79 [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.
2016-12-23 17:40:06 +03:00
Evgeny Mankov ac8166d051 [HIPIFY] Statistics in CSV file.
+ Stats by CUDA ref name.
+ Conversion %.

TODO: Calculation of changed code amount, based on actually replaced bytes.
2016-12-21 23:08:01 +03:00
Evgeny Mankov ea8e886077 [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.
2016-12-19 14:38:19 +03:00
Evgeny Mankov a9488603b4 [HIPIFY] nested macro is not hipified, when it isAnyIdentifier
Fix for https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/55
2016-12-15 21:00:34 +03:00