All Projects → JuliaGPU → Opencl.jl

JuliaGPU / Opencl.jl

Licence: other
OpenCL Julia bindings

Programming Languages

julia
2034 projects

Labels

Projects that are alternatives of or similar to Opencl.jl

Tvm Mali
Optimizing Mobile Deep Learning on ARM GPU with TVM
Stars: ✭ 156 (-27.78%)
Mutual labels:  opencl
Fast
A framework for GPU based high-performance medical image processing and visualization
Stars: ✭ 179 (-17.13%)
Mutual labels:  opencl
Inviwo
Inviwo - Interactive Visualization Workshop
Stars: ✭ 199 (-7.87%)
Mutual labels:  opencl
Khiva
An open-source library of algorithms to analyse time series in GPU and CPU.
Stars: ✭ 161 (-25.46%)
Mutual labels:  opencl
Gpu performance api
GPU Performance API for AMD GPUs
Stars: ✭ 170 (-21.3%)
Mutual labels:  opencl
Opencl Intercept Layer
Intercept Layer for Debugging and Analyzing OpenCL Applications
Stars: ✭ 189 (-12.5%)
Mutual labels:  opencl
Amdovx Core
AMD OpenVX Core -- a sub-module of amdovx-modules:
Stars: ✭ 139 (-35.65%)
Mutual labels:  opencl
Cuetools.net
CD image processing suite with optimized lossless encoders in C#
Stars: ✭ 208 (-3.7%)
Mutual labels:  opencl
Opentk
The Open Toolkit library is a fast, low-level C# wrapper for OpenGL, OpenAL & OpenCL. It also includes windowing, mouse, keyboard and joystick input and a robust and fast math library, giving you everything you need to write your own renderer or game engine. OpenTK can be used standalone or inside a GUI on Windows, Linux, Mac.
Stars: ✭ 2,284 (+957.41%)
Mutual labels:  opencl
Ck Caffe
Collective Knowledge workflow for Caffe to automate installation across diverse platforms and to collaboratively evaluate and optimize Caffe-based workloads across diverse hardware, software and data sets (compilers, libraries, tools, models, inputs):
Stars: ✭ 192 (-11.11%)
Mutual labels:  opencl
Computelibrary
The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
Stars: ✭ 2,123 (+882.87%)
Mutual labels:  opencl
Floor
A C++ Compute/Graphics Library and Toolchain enabling same-source CUDA/Host/Metal/OpenCL/Vulkan C++ programming and execution.
Stars: ✭ 166 (-23.15%)
Mutual labels:  opencl
Compute.scala
Scientific computing with N-dimensional arrays
Stars: ✭ 191 (-11.57%)
Mutual labels:  opencl
Clvk
Experimental implementation of OpenCL on Vulkan
Stars: ✭ 158 (-26.85%)
Mutual labels:  opencl
Pine
🌲 Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
Stars: ✭ 202 (-6.48%)
Mutual labels:  opencl
Compactcnncascade
A binary library for very fast face detection using compact CNNs.
Stars: ✭ 152 (-29.63%)
Mutual labels:  opencl
Clinfo
Print all known information about all available OpenCL platforms and devices in the system
Stars: ✭ 186 (-13.89%)
Mutual labels:  opencl
Bohrium
Automatic parallelization of Python/NumPy, C, and C++ codes on Linux and MacOSX
Stars: ✭ 209 (-3.24%)
Mutual labels:  opencl
Onednn
oneAPI Deep Neural Network Library (oneDNN)
Stars: ✭ 2,600 (+1103.7%)
Mutual labels:  opencl
Primestereomatch
A heterogeneous and fully parallel stereo matching algorithm for depth estimation, implementing a local adaptive support weight (ADSW) Guided Image Filter (GIF) cost aggregation stage. Developed in both C++ and OpenCL.
Stars: ✭ 191 (-11.57%)
Mutual labels:  opencl

OpenCL.jl

OpenCL bindings for Julia

Build status:

Code coverage:

Julia interface for the OpenCL parallel computation API

This package aims to be a complete solution for OpenCL programming in Julia, similar in scope to PyOpenCL for Python. It provides a high level api for OpenCL to make programing GPU's and multicore CPU's much less onerous.

OpenCL.jl provides access to OpenCL API versions 1.0, 1.1, 1.2 and 2.0.

This package is based off the work of others:

OpenCL.jl has had contributions from many developers.

Currently supported Julia versions

  • Julia v"0.4.x" is supported on the release-0.4 branch and the OpenCL.jl versions v"0.4.x". Only bug-fixes will be applied.
  • Julia v"0.5.x" is supported on the master branch and the OpenCL.jl versions v"0.5.x".
  • Julia v"0.6.x" is experimentally supported on the master branch and the OpenCL.jl versions v"0.5.x".

Discontinued support

  • Julia v"0.3.x" was supported on OpenCL.jl versions v"0.3.x". It should still be installable and work.

Setup

  1. Install an OpenCL driver. If you use OSX, OpenCL is already available
  2. Checkout the packages from the Julia repl
  Pkg.add("OpenCL")
  1. OpenCL will be installed in your .julia directory
  2. cd into your .julia directory to run the tests and try out the examples
  3. To update to the latest development version, from the Julia repl:
  Pkg.update()

IJulia Notebooks

Quick Example

using LinearAlgebra
using OpenCL

const sum_kernel = "
   __kernel void sum(__global const float *a,
                     __global const float *b,
                     __global float *c)
    {
      int gid = get_global_id(0);
      c[gid] = a[gid] + b[gid];
    }
"
a = rand(Float32, 50_000)
b = rand(Float32, 50_000)

device, ctx, queue = cl.create_compute_context()

a_buff = cl.Buffer(Float32, ctx, (:r, :copy), hostbuf=a)
b_buff = cl.Buffer(Float32, ctx, (:r, :copy), hostbuf=b)
c_buff = cl.Buffer(Float32, ctx, :w, length(a))

p = cl.Program(ctx, source=sum_kernel) |> cl.build!
k = cl.Kernel(p, "sum")

queue(k, size(a), nothing, a_buff, b_buff, c_buff)

r = cl.read(queue, c_buff)

if isapprox(norm(r - (a+b)), zero(Float32))
    @info "Success!"
else
    @error "Norm should be 0.0f"
end

Translation

Here's a rough translation between the OpenCL API in C to this Julia version. Optional arguments are indicated by [name?] (see clCreateBuffer, for example). For a quick reference to the C version, see the Khronos quick reference card.

Platform and Devices

C Julia Notes
clGetPlatformIDs cl.platforms()
clGetPlatformInfo cl.info(platform, :symbol) Platform info: :profile, :version, :name, :vendor, :extensions
clGetDeviceIDs cl.devices(), cl.devices(platform), cl.devices(:type) Device types: :all, :cpu, :gpu, :accelerator, :custom, :default
clGetDeviceInfo cl.info(device, :symbol) Device info: :driver_version, :version, :profile, :extensions, :platform, :name, :device_type, :has_image_support, :queue_properties, :has_queue_out_of_order_exec, :has_queue_profiling, :has_native_kernel, :vendor_id, :max_compute_units, :max_work_item_size, :max_clock_frequency, :address_bits, :max_read_image_args, :max_write_image_args, :global_mem_size, :max_mem_alloc_size, :max_const_buffer_size, :local_mem_size, :has_local_mem, :host_unified_memory, :available, :compiler_available, :max_work_group_size, :max_work_item_dims, :max_parameter_size, :profiling_timer_resolution, :max_image2d_shape, :max_image3d_shape
clCreateContext cl.context(queue), cl.context(CLMemObject),cl.context(CLArray)`
clReleaeContext cl.release!

Buffers

C Julia Notes
clCreateBuffer cl.Buffer(type, context, [length?]; [hostbuf?]), cl.Buffer(type, context, flags, [length?]; [hostbuf?]) Memory flags: :rw, :r, :w, :use, :alloc, :copy
clEnqueueCopyBuffer cl.copy!(queue, destination, source)
clEnqueueFillBuffer cl.enqueue_fill_buffer(queue, buffer, pattern, offset, nbytesm wait_for)
clEnqueueReadBuffer cl.enqueue_read_buffer(queue, buffer, hostbuf, dev_offset, wait_for, is_blocking)
clEnqueueWriteBuffer cl.enqueue_write_buffer(queue, buffer, hostbuf, byte_count, offset, wait_for, is_blocking)

Program Objects

C Julia Notes
clCreateProgramWithSource cl.Program(ctx; source)
clCreateProgramWithBinaries cl.Program(ctx; binaries)
clReleaseProgram cl.release!
clBuildProgram cl.build!(progrm, options)
clGetProgramInfo cl.info(program, :symbol) Program info: :reference_count, :devices, :context, :num_devices, :source, :binaries, :build_log, :build_status

Kernel and Event Objects

C Julia Notes
clCreateKernel cl.Kernel(program, "kernel_name")
clGetKernelInfo cl.info(kernel, :symbol) Kernel info: :name, :num_args, :reference_count, :program, :attributes
clEnqueueNDRangeKernel cl.enqueue_kernel(queue, kernel, global_work_size), cl.enqueue_kernel(queue, kernel, global_work_size, local_work_size; global_work_offset, wait_on)
clSetKernelArg cl.set_arg!(kernel, idx, arg) idx starts at 1
clCreateUserEvent cl.UserEvent(ctx; retain)
clGetEventInfo cl.info(event, :symbol) Event info: :context, :command_queue, :reference_count, :command_type, :status, :profile_start, :profile_end, :profile_queued, :profile_submit, :profile_duration
clWaitForEvents cl.wait(event), cl.wait(events)
clEnqueueMarkerWithWaitList cl.enqueue_marker_with_wait_list(queue, wait_for)
clEnqueueBarrierWithWaitList cl.enqueue_barrier_with_wait_list(queue, wait_for)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].