Skip to content

virus-warnning/pyopencl_samples

Repository files navigation

PyOpenCL Samples

Overview

N Description Detail
1 List OpenCL devices. View
2 Print "Hello World!" in CL language. View
3 Examine whether the device support double precision. View
4 Work group. View
5 Synchronize work items in a work group. View
6 Pass kernel arguments with different address spaces. View
7 printf() View
8 Do a merge sort and print it's progress.
9 Compare merge sort by CPU, merge sort by GPU and Python built-in sorted().
10 Convert a PNG to gray level.

Requirements

Windows

  • Make sure CPU or GPU driver installed.
  • Download Python 3.7 x86-64 executable installer.
  • Download pyopencl‑2018.1.1+cl12‑cp37‑cp37m‑win_amd64.whl from here.
  • Run Python 3.7 Installer.
  • Check Add Python 3.7 to PATH.
  • Install Python 3.7.
  • python -m pip install numpy pillow
  • python -m pip install pyopencl‑2018.1.1+cl12‑cp37‑cp37m‑win_amd64.whl

If your CPU is Intel Core 6th gen or newer, use pyopencl‑2018.1.1+cl21‑cp37‑cp37m‑win_amd64.whl instead.

macOS

  • brew install python3
  • pip3 install pyopencl pillow

Tested Environments

OS OpenCL Device
Windows 10 2.1 Intel Core i5 7200U + HD Graphics 620
Windows 10 1.2 Intel Core i5 3470 + HD Graphics 2500
macOS 10.13.3 1.2 Intel Core i7 3667U + HD Graphics 4000
macOS 10.13.3 1.2 Intel Core i5 5257U + Iris Graphics 6100

If you'd like to share test results of device not listed, just edit *.md files and give me a PR.

References

About

OpenCL samples in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages