<commit_before># HIP Porting Guide 
In addition to providing a portable C++ programming environment for GPUs, HIP is designed to ease
the porting of existing CUDA code into the HIP environment.  This section describes the available tools 
and provides practical suggestions on how to port CUDA code and work through common issues. 

## Table of Contents

<!-- toc -->

- [Porting a New Cuda Project](#porting-a-new-cuda-project)
  * [General Tips](#general-tips)
  * [Scanning existing CUDA code to scope the porting effort](#scanning-existing-cuda-code-to-scope-the-porting-effort)
  * [Converting a project "in-place"](#converting-a-project-in-place)
- [Distinguishing Compiler Modes](#distinguishing-compiler-modes)
  * [Identifying HIP Target Platform](#identifying-hip-target-platform)
  * [Identifying the Compiler: hcc or nvcc](#identifying-the-compiler-hcc-or-nvcc)
  * [Identifying Current Compilation Pass: Host or Device](#identifying-current-compilation-pass-host-or-device)
  * [Compiler Defines: Summary](#compiler-defines-summary)
- [Identifying Architecture Features](#identifying-architecture-features)
  * [HIP_ARCH Defines](#hip_arch-defines)
  * [Device-Architecture Properties](#device-architecture-properties)
  * [Table of Architecture Properties](#table-of-architecture-properties)
- [Finding HIP](#finding-hip)
- [hipLaunchKernel](#hiplaunchkernel)
- [Compiler Options](#compiler-options)
- [Linking Issues](#linking-issues)
  * [Linking With hipcc](#linking-with-hipcc)
  * [-lm Option](#-lm-option)
- [Linking Code With Other Compilers](#linking-code-with-other-compilers)
  * [libc++ and libstdc++](#libc-and-libstdc)
  * [HIP Headers (hip_runtime.h, hip_runtime_api.h)](#hip-headers-hip_runtimeh-hip_runtime_apih)
  * [Using a Standard C++ Compiler](#using-a-standard-c-compiler)
    + [cuda.h](#cudah)
  * [Choosing HIP File Extensions](#choosing-hip-file-extensions)
- [Workarounds](#workarounds)
  * [warpSize](#warpsize)
- [memcpyToSymbol](#memcpytosymbol)
- [threadfence_system](#threadfence_system)
  * [Textures and Cache Control](#textures-and-cache-control)
- [More Tips](#more-tips)
  * [HIPTRACE Mode](#hiptrace-mode)<commit_msg>Fix documentation about hip-clang macros<commit_after># HIP Porting Guide 
In addition to providing a portable C++ programming environment for GPUs, HIP is designed to ease
the porting of existing CUDA code into the HIP environment.  This section describes the available tools 
and provides practical suggestions on how to port CUDA code and work through common issues. 

## Table of Contents

<!-- toc -->

- [Porting a New Cuda Project](#porting-a-new-cuda-project)
  * [General Tips](#general-tips)
  * [Scanning existing CUDA code to scope the porting effort](#scanning-existing-cuda-code-to-scope-the-porting-effort)
  * [Converting a project "in-place"](#converting-a-project-in-place)
- [Distinguishing Compiler Modes](#distinguishing-compiler-modes)
  * [Identifying HIP Target Platform](#identifying-hip-target-platform)
  * [Identifying the Compiler: hcc, hip-clang, or nvcc](#identifying-the-compiler-hcc-hip-clang-or-nvcc)
  * [Identifying Current Compilation Pass: Host or Device](#identifying-current-compilation-pass-host-or-device)
  * [Compiler Defines: Summary](#compiler-defines-summary)
- [Identifying Architecture Features](#identifying-architecture-features)
  * [HIP_ARCH Defines](#hip_arch-defines)
  * [Device-Architecture Properties](#device-architecture-properties)
  * [Table of Architecture Properties](#table-of-architecture-properties)
- [Finding HIP](#finding-hip)
- [hipLaunchKernel](#hiplaunchkernel)
- [Compiler Options](#compiler-options)
- [Linking Issues](#linking-issues)
  * [Linking With hipcc](#linking-with-hipcc)
  * [-lm Option](#-lm-option)
- [Linking Code With Other Compilers](#linking-code-with-other-compilers)
  * [libc++ and libstdc++](#libc-and-libstdc)
  * [HIP Headers (hip_runtime.h, hip_runtime_api.h)](#hip-headers-hip_runtimeh-hip_runtime_apih)
  * [Using a Standard C++ Compiler](#using-a-standard-c-compiler)
    + [cuda.h](#cudah)
  * [Choosing HIP File Extensions](#choosing-hip-file-extensions)
- [Workarounds](#workarounds)
  * [warpSize](#warpsize)
- [memcpyToSymbol](#memcpytosymbol)
- [threadfence_system](#threadfence_system)
  * [Textures and Cache Control](#textures-and-cache-control)
- [More Tips](#more-tips)
  * [HIPTRACE Mode](#hiptrace-mode)
{'fraction_non_alphanumeric': 0.1385912924549806, 'fraction_numerical': 0.0, 'mean_word_length': 5.491124260355029, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1989105', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1383, 'n_words': 314}