Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/plugins_build_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
libsndfile1-dev libasound2-dev libportaudio2 libportmidi-dev \
libeigen3-dev libfluidsynth-dev libpng-dev \
libwebsockets-dev libuv1-dev libhdf5-dev \
ocl-icd-opencl-dev \
flex bison

- name: Cache Csound install
Expand Down Expand Up @@ -114,7 +115,8 @@ jobs:
build/src/image/*.so \
build/src/websockets/*.so \
build/src/hdf5/*.so \
build/src/py/*.so package/
build/src/py/*.so \
build/src/OpenCL/*.so package/

- name: Upload plugins
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -216,7 +218,8 @@ jobs:
build/src/image/*.dylib \
build/src/websockets/*.dylib \
build/src/hdf5/*.dylib \
build/src/py/*.dylib package/
build/src/py/*.dylib \
build/src/OpenCL/*.dylib package/

- name: Upload plugins
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions 7.x/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,4 @@ add_subdirectory(./src/py)
add_subdirectory(./src/wiimote)
add_subdirectory(./src/p5glove)
add_subdirectory(./src/CUDA)
add_subdirectory(./src/OpenCL)
19 changes: 18 additions & 1 deletion 7.x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Currently, the plugins available in this tree are
- CUDA (requires the CUDA toolkit; Linux only, disabled by default, see note below)
**cudasynth cudanal cudasliding cudaconv cudapconv**

- OpenCL (requires the OpenCL headers/loader; see note below)
**cladsyn**


Fluid settings opcodes
---
Expand Down Expand Up @@ -106,6 +109,20 @@ is ignored. The compute capabilities default to `75 80 86 89`; override with
`-DCMAKE_CUDA_ARCHITECTURES="..."` (for example `native` for the local GPU).


OpenCL opcodes
---

The `OpenCL` opcode (`cladsyn`) is a port of the Csound 6.x plugin to the
Csound 7 plugin API. It runs its DSP kernels on any available OpenCL device
(CPU or GPU) through the ICD loader.

It is built by default when OpenCL is available: the system framework is used
on macOS, `ocl-icd-opencl-dev` on Linux and the vcpkg `opencl` port on Windows.
Configure with `-DBUILD_OPENCL_OPCODES=OFF` to exclude it. The CI builds it
compile-only (the hosted runners have no OpenCL device) and it is included in
the Linux, macOS and Windows release packages.


Install location
--------------
The CMake scripts in this repository use the default CS_USER_PLUGIN
Expand Down Expand Up @@ -146,7 +163,7 @@ $ make
By default, all the plugins are built. If one wants to exclude a
plugin from the build process, one can pass an option to the cmake command.
The options are `BUILD_CHUA_OPCODES`, `BUILD_CUDA_OPCODES`,
`BUILD_FLUID_OPCODES`,
`BUILD_OPENCL_OPCODES`, `BUILD_FLUID_OPCODES`,
`BUILD_IMAGE_OPCODES`, `BUILD_HDF5_OPCODES`, `BUILD_LINEAR_ALGEBRA_OPCODES`,
`BUILD_P5GLOVE_OPCODES`, `BUILD_WIIMOTE_OPCODES`, `BUILD_WEBSOCKET_OPCODE` and
`BUILD_PYTHON_OPCODES`. For example, to
Expand Down
24 changes: 24 additions & 0 deletions 7.x/src/OpenCL/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build the OpenCL opcodes.
#
# The OpenCL headers and ICD loader come from the system framework on macOS,
# from vcpkg on Windows, and from ocl-icd-opencl-dev on Linux.
option(BUILD_OPENCL_OPCODES "Build the OpenCL opcodes" ON)

if(APPLE OR NOT USE_VCPKG)
find_package(OpenCL)
else()
find_package(OpenCL CONFIG)
endif()

check_deps(BUILD_OPENCL_OPCODES OpenCL_FOUND)

if(BUILD_OPENCL_OPCODES AND OpenCL_FOUND)
make_plugin(clop cladsynth.c)
target_include_directories(clop PRIVATE ${CSOUND_INCLUDE_DIRS})
if(TARGET OpenCL::OpenCL)
target_link_libraries(clop PRIVATE OpenCL::OpenCL)
else()
target_include_directories(clop PRIVATE ${OpenCL_INCLUDE_DIRS})
target_link_libraries(clop PRIVATE ${OpenCL_LIBRARIES})
endif()
endif()
Loading
Loading