Skip to content

Commit

Permalink
a lil CI
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Nov 25, 2023
1 parent a16d770 commit 7f81684
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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 [email protected]: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"

11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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 <HIP library someday?> 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',
Expand Down

0 comments on commit 7f81684

Please sign in to comment.