# Can NVCC compile and/or generate GPU code using OpenMP?

**URL:** <https://forums.developer.nvidia.com/t/can-nvcc-compile-and-or-generate-gpu-code-using-openmp/202079>\
**Category:** CUDA NVCC Compiler\
**Created:** [January 31, 2022, 12:22pm UTC](https://forums.developer.nvidia.com/t/can-nvcc-compile-and-or-generate-gpu-code-using-openmp/202079 "2022-01-31T12:22:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wrichikbiswas1999](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/wrichikbiswas1999/32/103545_2.png) [@wrichikbiswas1999](https://forums.developer.nvidia.com/u/wrichikbiswas1999)\
**Post date:** [January 31, 2022, 12:22pm UTC](https://forums.developer.nvidia.com/t/can-nvcc-compile-and-or-generate-gpu-code-using-openmp/202079/1 "2022-01-31T12:22:08Z")

</div>

I understand `nvcc` can generate GPU code using CUDA and OpenACC using `#pragma acc kernels` . Since OpenMP 4.0 released, it had the `target` construct to offload work to a GPU. Can `nvcc` be used to generate GPU code using the OpenMP `target` construct?

---

<div class="post-metadata">

**Author:** ![never\_released](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@never\_released](https://forums.developer.nvidia.com/u/never_released)\
**Post date:** [February 1, 2022, 7:33pm UTC](https://forums.developer.nvidia.com/t/can-nvcc-compile-and-or-generate-gpu-code-using-openmp/202079/2 "2022-02-01T19:33:44Z")

</div>

For OpenMP support, you need to use nvc++ (provided as part of the NVIDIA HPC SDK).
