Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
neon60 committed May 23, 2024
1 parent 0918fc1 commit c948873
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions docs/how-to/hip_porting_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ This can be quite handy when dealing with an existing CUDA code base since the s
and filenames - and includes work. After converting in-place, you can review the code to add additional parameters to
directory names.
```shell
> hipconvertinplace-perl.sh MY_SRC_DIR
```
Expand Down Expand Up @@ -196,7 +195,7 @@ if __HIP_ARCH_HAS_DOUBLES__ { // portable HIP feature query
}
```
For host code, the `__HIP_ARCH__*` defines are set to 0. You should only use the __HIP_ARCH__ fields in device code.
For host code, the `__HIP_ARCH__*` defines are set to 0. You should only use the `__HIP_ARCH__` fields in device code.
### Device-Architecture Properties
Expand Down Expand Up @@ -366,9 +365,11 @@ run hipcc when appropriate.
## Workarounds
### warpSize
Code should not assume a warp size of 32 or 64. See [Warp Cross-Lane Functions](https://rocm.docs.amd.com/projects/HIP/en/latest/reference/kernel_language.html#warp-cross-lane-functions) for information on how to write portable wave-aware code.
### Kernel launch with group size > 256
Kernel code should use ``` __attribute__((amdgpu_flat_work_group_size(<min>,<max>)))```.
For example:
Expand Down Expand Up @@ -450,6 +451,7 @@ hipHostMalloc(&ptrHost, sizeof(double));
hipPointerAttribute_t attr;
hipPointerGetAttributes(&attr, ptrHost); /*attr.type will have value as hipMemoryTypeHost*/
```
Please note, hipMemoryType enum values are different from cudaMemoryType enum values.
For example, on AMD platform, hipMemoryType is defined in hip_runtime_api.h,
Expand All @@ -463,6 +465,7 @@ typedef enum hipMemoryType {
hipMemoryTypeManaged = 4 ///< Managed memory, automaticallly managed by the unified memory system
} hipMemoryType;
```
Looking into CUDA toolkit, it defines cudaMemoryType as following,
```cpp
Expand Down
4 changes: 2 additions & 2 deletions util/vim/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
### How to install? ###

1. Add the <code>hip.vim</code> to <code>~/.vim/syntax/</code> directory
2. Add the following text to the end of <code>~/.vimrc</code>


```
```shell
augroup filetypedetect
au BufNewFile,BufRead *.cpp set filetype=cpp syntax=hip
augroup END
Expand Down

0 comments on commit c948873

Please sign in to comment.