# Nvcc compiler error - error: calling a \_\_host\_\_ function from a \_\_global\_\_ function is not allowed

**URL:** <https://forums.developer.nvidia.com/t/nvcc-compiler-error-error-calling-a-host-function-from-a-global-function-is-not-allowed/220073>\
**Category:** CUDA Programming and Performance\
**Created:** [July 7, 2022, 11:18am UTC](https://forums.developer.nvidia.com/t/nvcc-compiler-error-error-calling-a-host-function-from-a-global-function-is-not-allowed/220073 "2022-07-07T11:18:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![larryyang1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@larryyang1](https://forums.developer.nvidia.com/u/larryyang1)\
**Post date:** [July 7, 2022, 11:18am UTC](https://forums.developer.nvidia.com/t/nvcc-compiler-error-error-calling-a-host-function-from-a-global-function-is-not-allowed/220073/1 "2022-07-07T11:18:28Z")

</div>

Hi There,

I encountered a lot of nvcc (-std c++17) compiling error as below, any comments to help me out? thanks!

error: calling a **host** function(“nda::interval\<(long)-9l, (long)-9l\> ::extent const”) from a **global** function(“BilateralSliceKernel”) is not allowed

---

<div class="post-metadata">

**Author:** ![striker159](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@striker159](https://forums.developer.nvidia.com/u/striker159)\
**Post date:** [July 7, 2022, 12:27pm UTC](https://forums.developer.nvidia.com/t/nvcc-compiler-error-error-calling-a-host-function-from-a-global-function-is-not-allowed/220073/2 "2022-07-07T12:27:09Z")

</div>

You cannot use function `nda::interval::extend` in a kernel if the function is not a device or host-device function.
