Jupyter notebook plugin to run CUDA C/C++ code
Project description
nvcc4jupyter: CUDA C++ plugin for Jupyter Notebook
Testing | |
Package |
nvcc4jupyter is a Jupyter Notebook plugin that provides cell and line magics to allow running CUDA C++ code from a notebook. This is especially useful when combined with a hosted service such a Google's Colab which provide CUDA capable GPUs and you can start learning CUDA C++ without having to install anything or even to own a GPU yourself.
Table of Contents
Main Features
Here are just a few of the things that nvcc4jupyter does well:
- Easily run CUDA C++ code
- Profile your code with NVIDIA Nsight Compute
- Share code between different programs in the same notebook / split your code into multiple files for improved readability
Install
The installer for the latest released version is available at the Python Package Index (PyPI).
pip install nvcc4jupyter
Usage
First, load the extension to enable the magic commands:
%load_ext nvcc4jupyter
Running a quick CUDA Hello World program:
%%cuda
#include <stdio.h>
__global__ void hello(){
printf("Hello from block: %u, thread: %u\n", blockIdx.x, threadIdx.x);
}
int main(){
hello<<<2, 2>>>();
cudaDeviceSynchronize();
}
For more advanced use cases, see the documentation.
Documentation
The official documentation is hosted on readthedocs.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nvcc4jupyter-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a34a185a2db005f920448609be71bd1b3fb7c9246406ac4fdc948b1f534df166 |
|
MD5 | ebcb24984d8917cfbad4ba0a155aebfb |
|
BLAKE2b-256 | 5ea05d6705c071ae6cbdc55a5e7c7f6fb88d3ca3e9f7be2ac595aae5a2fd86a3 |