Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pycuda-example

A small working CUDA example powered by Python and PyCUDA. Go to main.py to view the code.

The example implements an algorithm that counts the relatively non-prime numbers (GCD is not 1) for each number up to size=1000.

Also in the file main.cu a complete native CUDA code attached that does the same as in the python example.

Requirements

For running C example only, first 3 points above will be enough.

How to run

Python example in main.py

  1. Create a virtualenv: python -m virtualenv .venv
  2. Activate the virtualenv: source ./.venv/bin/activate (or .\.venv\Scripts\activate for Windows)
  3. Install requirements: pip install -r requirements.txt
  4. Run the script: python main.py

C example in main.cu

  1. Compile the code: nvcc -arch=native main.cu -o main (or nvcc main.cu -o main.exe for Windows)
  2. Run the exe-file: ./main (or .\main.exe for Windows)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages