diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..29d8afa --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: Unit Tests + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + buildpackage: + name: Build Package + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install ctypeslib + run: | + git clone git@github.com:geohot/ctypeslib.git + cd ctypeslib + pip install . + - name: Install HIP + run: | + sudo mkdir --parents --mode=0755 /etc/apt/keyrings + wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null + echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.7.1 jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list + echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 + sudo apt update + sudo apt install rocm-hip-sdk + - name: Generate headers + run: ./generate.sh + - name: Install gpuctypes + run: pip install . + - name: Test gpuctypes + run: python3 -c "import gpuctypes.hip" + diff --git a/setup.py b/setup.py index 8085a07..49a8c15 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,20 @@ #!/usr/bin/env python3 from setuptools import setup + +description = """Do you wish that there were simple wrappers for GPU libraries in Python? + +Like not pyopencl, pycuda, and here, but just raw access to the APIs? + +That's what gpuctypes does! While high level libraries have their place, the world needs more low level libraries. + +Like gpuctypes. Welcome home. +""" + setup(name='gpuctypes', version='0.1.0', description='ctypes wrappers for HIP, CUDA, and OpenCL', author='George Hotz', + long_description=description, license='MIT', packages = ['gpuctypes'], python_requires='>=3.8',