Commit Graph

80 Commits

Author SHA1 Message Date
Evgeny Mankov 24fc06496b Update Cuda2Hip.cpp
[ROCm/hip commit: d614f53ad7]
2017-07-28 01:45:24 +03:00
Evgeny Mankov 21c012ffca [HIPIFY] CUDA RT Textures support
[ROCm/hip commit: ffcf5d32a0]
2017-07-27 18:39:40 +03:00
Evgeny Mankov 9ba397e8fe [HIPIFY] CUDA Stream Callback support
[ROCm/hip commit: 368aebc4bc]
2017-07-26 19:29:50 +03:00
Evgeny Mankov e17a4fffa9 [HIPIFY] Finally finished syncing with CUDA 8.0.61 Driver and Runtime… (#105)
[hipify-clang] Finally finished syncing with CUDA 8.0.61 Driver and Runtime API (including missing data types, D3D, OpenGL, VDPAU and EGL interop).

    + All the Modules are supported now:
	1) 4.1 – 4.31 from CUDA 8.0.61 Driver API
	2) CUDA_Driver_API_functions_supported_by_HIP.md updated accordingly
	3) 4.1 – 4.31 from CUDA 8.0.61 Runtime API
	4) CUDA_Runtime_API_functions_supported_by_HIP.md updated accordingly
    + Typos fixing
    + Annotating

[ROCm/hip commit: 85e6593a1b]
2017-07-26 09:38:03 +05:30
Maneesh Gupta 3880597399 Update toc in markdown documentation
Change-Id: I6da7053672b306442f3640fff3471efe25593870


[ROCm/hip commit: 91f82ce541]
2017-06-28 11:32:25 +05:30
Evgeny Mankov 7bcee25b43 [HIPIFY] [DOC] Fix typo.
[ROCm/hip commit: d239b1a3fc]
2017-06-23 21:59:24 +03:00
Evgeny Mankov c396932615 [HIPIFY] Sync more CUDA Driver API functions.
+ 4.14. Event Management
+ 4.15. Execution Control

ToDo: 4.16 - 4.31 modules of CUDA Driver API.


[ROCm/hip commit: b4a39664f0]
2017-06-22 21:53:32 +03:00
Evgeny Mankov c351308890 [HIPIFY] Sync HIPIFY with HIP by CUDA Driver API functions.
+ 4.12. Unified Addressing
+ 4.13. Stream Management

ToDo: 4.14 - 4.31 modules of CUDA Driver API.


[ROCm/hip commit: 0208fa4e70]
2017-06-14 19:55:55 +03:00
Evgeny Mankov df7cbf0a1a [HIPIFY] Initial sync HIPIFY with HIP by CUDA Driver API functions.
+ CUDA_Driver_API_functions_supported_by_HIP.md update.
+ Initial update of HIPIFY with CUDA driver API functions:
  1.Error Handling, 2.Initialization, 3.Version Management, 5-6.Device Management, 7.Primary Context, 8-9.Context, 10.Module Management, 11.Memory Management.
+ Sync HIP functions against CUDA Driver and Runtime API functions.
+ Typo fixes.

ToDo: 12-30 modules of CUDA Driver API.


[ROCm/hip commit: f805bd0c1d]
2017-06-13 20:25:11 +03:00
Evgeny Mankov 0c12f09ba5 [HIPIFY] All CUDA 8.0.44 API functions update
(for both Driver and Runtime APIs)

1) P2P
cuDeviceGetP2PAttribute   cudaDeviceGetP2PAttribute

2) Memory Mngmnt
cuMemPrefetchAsync        cudaMemPrefetchAsync
cuMemAdvise               cudaMemAdvise
cuMemRangeGetAttribute    cudaMemRangeGetAttribute
cuMemRangeGetAttributes   cudaMemRangeGetAttributes

3) Streams (Driver API only, no analogues in Runtime API)
cuStreamWaitValue32
cuStreamWaitValue32
cuStreamWriteValue32

4) Texture Reference Mngmnt (Driver API only, no analogues in Runtime API)
cuTexRefSetBorderColor
cuTexRefGetBorderColor


[ROCm/hip commit: 4a5484c616]
2017-06-01 21:08:33 +03:00
Evgeny Mankov 7a3befc555 [HIP] [HIPIFY] CUDA Driver API 8.0.44 JIT options support.
[ROCm/hip commit: 6e99e388ea]
2017-05-31 18:55:29 +03:00
Evgeny Mankov f99ab93b61 [HIPIFY] Add the rest CUDA Runtime API 8.0.44 Data structures.
+ sync with corresponding CUDA Driver API Data structures.

P.S.
There is no any new changes in CUDA Runtime API 8.0.61 Data structures since 8.0.44.


[ROCm/hip commit: 063539308e]
2017-05-30 19:45:59 +03:00
Evgeny Mankov 8a05cf882f [HIPIFY] Add the rest CUDA Driver API 8.0.44 Data structures.
+ Memory advise values
+ Memory Range Attributes
+ P2P Attributes

P.S.
There is no any new changes in CUDA Driver API 8.0.61 Data structures since 8.0.44.


[ROCm/hip commit: 1cc5f42e34]
2017-05-30 18:29:14 +03:00
Evgeny Mankov 8574437d36 [HIPIFY] Add more CUDA Driver API 8.0.44 Data structures.
[ROCm/hip commit: 3e99bc23e7]
2017-05-30 17:58:13 +03:00
Evgeny Mankov bc9b970f82 [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> &)


[ROCm/hip commit: c863215611]
2017-05-24 18:25:40 +03:00
Evgeny Mankov 0a43773e0d [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];


[ROCm/hip commit: 3d973dc4da]
2017-05-23 19:45:38 +03:00
Evgeny Mankov cb7e073c42 [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.


[ROCm/hip commit: b5a1d47e68]
2017-05-19 17:39:09 +03:00
Evgeny Mankov 042de3e175 [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.


[ROCm/hip commit: 270f643c9c]
2017-05-19 17:22:14 +03:00
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