All Projects → gos-k → oclcl

gos-k / oclcl

Licence: other
S-expression to OpenCL C

Programming Languages

common lisp
692 projects
shell
77523 projects

Projects that are alternatives of or similar to oclcl

RayTracing
Realtime GPU Path tracer based on OpenCL and OpenGL
Stars: ✭ 120 (+185.71%)
Mutual labels:  opencl
spector
Spector: An OpenCL FPGA Benchmark Suite
Stars: ✭ 38 (-9.52%)
Mutual labels:  opencl
pytorch dlprim
DLPrimitives/OpenCL out of tree backend for pytorch
Stars: ✭ 51 (+21.43%)
Mutual labels:  opencl
pystella
A code generator for grid-based PDE solving on CPUs and GPUs
Stars: ✭ 18 (-57.14%)
Mutual labels:  opencl
faster lmm d
A faster lmm for GWAS. Supports GPU backend.
Stars: ✭ 12 (-71.43%)
Mutual labels:  opencl
Learning-Lab-C-Library
This library provides a set of basic functions for different type of deep learning (and other) algorithms in C.This deep learning library will be constantly updated
Stars: ✭ 20 (-52.38%)
Mutual labels:  opencl
sycl-bench
SYCL Benchmark Suite
Stars: ✭ 30 (-28.57%)
Mutual labels:  opencl
SoliditySHA3Miner
All-in-one mixed multi-GPU (nVidia, AMD, Intel) & CPU miner solves proof of work to mine supported EIP918 tokens in a single instance (with API).
Stars: ✭ 28 (-33.33%)
Mutual labels:  opencl
BetterVanillaGenerator
This plugin not only provides better terrain generators for Nukkit, you can also customize your world by modifying the configuration.
Stars: ✭ 26 (-38.1%)
Mutual labels:  opencl
slibs
Single file libraries for C/C++
Stars: ✭ 80 (+90.48%)
Mutual labels:  opencl
primitiv-python
Python binding of primitiv.
Stars: ✭ 17 (-59.52%)
Mutual labels:  opencl
Hetero-Mark
A Benchmark Suite for Heterogeneous System Computation
Stars: ✭ 41 (-2.38%)
Mutual labels:  opencl
ctuning-programs
Collective Knowledge extension with unified and customizable benchmarks (with extensible JSON meta information) to be easily integrated with customizable and portable Collective Knowledge workflows. You can easily compile and run these benchmarks using different compilers, environments, hardware and OS (Linux, MacOS, Windows, Android). More info:
Stars: ✭ 41 (-2.38%)
Mutual labels:  opencl
rouziclib
This is my personal library of code that is common to my different projects (Photosounder, SplineEQ, Spiral and others)
Stars: ✭ 38 (-9.52%)
Mutual labels:  opencl
focal
A modern Fortran abstraction layer for OpenCL
Stars: ✭ 35 (-16.67%)
Mutual labels:  opencl
FAST-Pathology
⚡ Open-source software for deep learning-based digital pathology
Stars: ✭ 54 (+28.57%)
Mutual labels:  opencl
folding-at-home
A Folding@Home Docker container with GPU support
Stars: ✭ 38 (-9.52%)
Mutual labels:  opencl
croatoan
Common Lisp bindings for the ncurses terminal library.
Stars: ✭ 111 (+164.29%)
Mutual labels:  quicklisp
cl-slug
Small library to make slugs, mainly for URIs, from english and beyond.
Stars: ✭ 22 (-47.62%)
Mutual labels:  quicklisp
voxel-raycaster
Hardware accelerated voxel ray marching
Stars: ✭ 30 (-28.57%)
Mutual labels:  opencl

oclcl

CircleCI Status TravisCI Status Quicklisp

oclcl is a library to use OpenCL in Common Lisp programs. It provides the kernel description language with which users can define OpenCL kernel functions in S-expression. The kernel description language also provides facilities to define kernel macros and kernel symbol macros in addition to kernel functions. oclcl's kernel macro and kernel symbol macro offer powerful abstraction that OpenCL C itself does not have and provide enormous advantage in resource-limited GPU programming.

Installation

oclcl is now available on Quicklisp.

(ql:quickload :oclcl)

Requirements

oclcl requires following:

  • OpenCL 1.2
  • SBCL 1.3.1

Test

(ql:quickload :prove)
(prove:run :oclcl-test)

or

$ ros install prove
$ run-prove oclcl/oclcl-test.asd

Verification environments

oclcl is verified to work in following environments:

Environment 1

  • Ubuntu 15.04 x86_64
  • Intel Core i5-4210U
  • POCL 0.10
  • SBCL 1.3.1 64-bit
  • Roswell 0.0.3.50

Environment 2

  • Ubuntu 16.04 x86_64
  • NVIDIA GeForce GTX 660
  • OpenCL 1.2 CUDA 8.0.20
  • SBCL 1.3.4 64-bit
  • Roswell 0.0.5.59

Environment 3

  • Ubuntu 14.04 x86_64
  • AMD Radeon HD 5700 Series
  • OpenCL C 1.2
  • SBCL 1.3.2 64-bit
  • Roswell 0.0.5.58

Kernel Description Language

Types

Support types.

  • char char2 char3 char4 char8 char16
  • char* char2* char3* char4* char8* char16*
  • uchar uchar2 uchar3 uchar4 uchar8 uchar16
  • uchar* uchar2* uchar3* uchar4* uchar8* uchar16*
  • short short2 short3 short4 short8 short16
  • short* short2* short3* short4* short8* short16*
  • ushort ushort2 ushort3 ushort4 ushort8 ushort16
  • ushort* ushort2* ushort3* ushort4* ushort8* ushort16*
  • int int2 int3 int4 int8 int16
  • int* int2* int3* int4* int8* int16*
  • uint uint2 uint3 uint4 uint8 uint16
  • uint* uint2* uint3* uint4* uint8* uint16*
  • long long2 long3 long4 long8 long16
  • long* long2* long3* long4* long8* long16*
  • ulong ulong2 ulong3 ulong4 ulong8 ulong16
  • ulong* ulong2* ulong3* ulong4* ulong8* ulong16*
  • float float2 float3 float4 float8 float16
  • float* float2* float3* float4* float8* float16*
  • double double2 double3 double4 double8 double16
  • double* double2* double3* double4* double8* double16*
  • bool void size-t

IF statement

IF test-form then-form [else-form]

if allows the execution of a form to be dependent on a single test-form. First test-form is evaluated. If the result is true, then then-form is selected; otherwise else-form is selected. Whichever form is selected is then evaluated. If else-form is not provided, does nothing when else-form is selected.

Example:

(if (= a 0)
    (return 0)
    (return 1))

Compiled:

if (a == 0) {
  return 0;
} else {
  return 1;
}

LET statement

LET ({(var init-form)}*) statement*

let declares new variable bindings and set corresponding init-forms to them and execute a series of statements that use these bindings. let performs the bindings in parallel. For sequentially, use let* kernel macro instead.

Example:

(let ((i 0))
  (return i))

Compiled:

{
  int i = 0;
  return i;
}

SYMBOL-MACROLET statement

SYMBOL-MACROLET ({(symbol expansion)}*) statement*

symbol-macrolet establishes symbol expansion rules in the variable environment and execute a series of statements that use these rules. In cl-cuda's compilation process, the symbol macros found in a form are replaces by corresponding expansions.

Example:

(symbol-macrolet ((x 1.0))
  (return x))

Compiled:

{
  return 1.0;
}

DO statement

DO ({(var init-form step-form)}*) (test-form) statement*

do iterates over a group of statements while test-form holds. do accepts an arbitrary number of iteration vars and their initial values are supplied by init-forms. step-forms supply how the vars should be updated on succeeding iterations through the loop.

Example:

(do ((a 0 (+ a 1))
     (b 0 (+ b 1)))
    ((> a 15))
  (do-some-statement))

Compiled:

for ( int a = 0, int b = 0; ! (a > 15); a = a + 1, b = b + 1 )
{
  do_some_statement();
}

WITH-LOCAL-MEMORY statement

WITH-LOCAL-MEMORY ({(var type size*)}*) statement*

with-local-memory declares new variable bindings on local memory by adding __local variable specifiers. It allows to declare array variables if dimensions are provided. A series of statements are executed with these bindings.

Example:

(with-local-memory ((a int 16)
                    (b float 16 16))
  (return))

Compiled:

{
  __local int a[16];
  __local float b[16][16];
  return;
}

SET statement

SET reference expression

set provides simple variable assignment. It accepts one of variable, structure and array references as reference.

Example:

(set x 1.0)
(set (float4-x y 1.0)
(set (aref z 0) 1.0)

Compiled:

x = 1.0;
y.x = 1.0;
z[0] = 1.0;

PROGN statement

PROGN statement*

progn evaluates statements, in the order in which they are given.

Example:

(progn
  (do-some-statements)
  (do-more-statements))

Compiled:

do_some_statements();
do_more_statements();

RETURN statement

RETURN [return-form]

return returns control, with return-form if supplied, from a kernel function.

Example:

(return 0)

Compiled:

return 0;

Built in Functions

Implementation status of built in functions.

Status Functions
Yes Work-Item
Part Math
Yes Integer
Part Common
Yes Geometric
No Relational
No Vector Data Load and Store
Yes Synchronization
Yes Explicit Memory Fence
No Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch
Yes Atomic
Yes Miscellaneous Vector
Yes printf
No Image Read and Write Functions

Author

C source generator is forked from cl-cuda.

Copyright

2015 gos-k ([email protected])

cl-cuda

Copyright (c) 2012 Masayuki Takagi ([email protected])

License

Licensed under the LLGPL License.

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].