• Anaconda Platform
  • – Welcome
  • – Anaconda
  • – Anaconda Repository
  • – Anaconda Accelerate
  • – Anaconda Adam
  • – Anaconda Enterprise Notebooks
  • – Anaconda Fusion
  • – Anaconda Scale
  • – Anaconda Cloud
  • Continuum-sponsored OSS programs
  • – Blaze
  • – Bokeh
  • – Conda
  • – dask
  • – llvmlite
  • – PhosphorJS
  • – Numba
    • User Manual
    • Reference Manual
    • Numba for CUDA GPUs
      • Overview
      • Writing CUDA Kernels
      • Memory management
      • Writing Device Functions
      • Supported Python features in CUDA Python
      • Supported Atomic Operations
      • Random Number Generation
      • Device management
      • The Device List
      • Examples
      • Debugging CUDA Python with the the CUDA Simulator
      • GPU Reduction
      • CUDA Ufuncs and Generalized Ufuncs
      • Sharing CUDA Memory
      • CUDA Frequently Asked Questions
    • CUDA Python Reference
    • Numba for HSA APUs
    • Extending Numba
    • Developer Manual
    • Numba Enhancement Proposals
    • Glossary
    • Release Notes
  • Top OSS programs

Writing Device FunctionsΒΆ

CUDA device functions can only be invoked from within the device (by a kernel or another device function). To define a device function:

from numba import cuda

@cuda.jit(device=True)
def a_device_function(a, b):
    return a + b

Unlike a kernel function, a device function can return a value like normal functions.

Docs Home
Continuum Analytics Home
More Help & Support
2017 Continuum Analytics, Inc.
All Rights Reserved.
Privacy Policy | EULA