{"id":13442794,"url":"https://github.com/gos-k/oclcl","last_synced_at":"2026-01-07T03:34:49.632Z","repository":{"id":139076186,"uuid":"47054982","full_name":"gos-k/oclcl","owner":"gos-k","description":"S-expression to OpenCL C","archived":false,"fork":false,"pushed_at":"2019-03-08T08:36:03.000Z","size":667,"stargazers_count":47,"open_issues_count":0,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-01T09:30:04.845Z","etag":null,"topics":["common-lisp","opencl","quicklisp"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gos-k.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-11-29T07:58:45.000Z","updated_at":"2024-09-02T19:53:15.000Z","dependencies_parsed_at":"2024-01-23T18:21:25.593Z","dependency_job_id":"275c46a0-5678-42f7-b80a-773e558f0dd3","html_url":"https://github.com/gos-k/oclcl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gos-k%2Foclcl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gos-k%2Foclcl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gos-k%2Foclcl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gos-k%2Foclcl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gos-k","download_url":"https://codeload.github.com/gos-k/oclcl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245779686,"owners_count":20670712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["common-lisp","opencl","quicklisp"],"created_at":"2024-07-31T03:01:51.038Z","updated_at":"2026-01-07T03:34:49.626Z","avatar_url":"https://github.com/gos-k.png","language":"Common Lisp","funding_links":[],"categories":["Common Lisp"],"sub_categories":[],"readme":"# oclcl\n\n[![CircleCI Status](https://circleci.com/gh/gos-k/oclcl.svg?style=shield)](https://circleci.com/gh/gos-k/oclcl)\n[![TravisCI Status](https://travis-ci.org/gos-k/oclcl.svg?branch=master)](https://travis-ci.org/gos-k/oclcl)\n[![Quicklisp](http://quickdocs.org/badge/oclcl.svg)](http://quickdocs.org/oclcl/)\n\noclcl is a library to use [OpenCL](https://www.khronos.org/opencl/) in Common Lisp programs.\nIt provides the kernel description language with which users can define OpenCL kernel functions in S-expression.\nThe kernel description language also provides facilities to define kernel macros and kernel symbol macros in addition to kernel functions.\noclcl'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.\n\n## Installation\n\noclcl is now available on [Quicklisp](https://www.quicklisp.org).\n\n    (ql:quickload :oclcl)\n\n## Requirements\n\noclcl requires following:\n\n* OpenCL 1.2\n* SBCL 1.3.1\n\n## Test\n\n    (ql:quickload '(:oclcl-tests :rove))\n    (rove:run :oclcl-tests)\n    (rove:run-test 'oclcl.tests.lang.program::make-program)\n\nor\n\n    $ ros install rove\n    $ rove oclcl.asd\n\n## Verification environments\n\noclcl is verified to work in following environments:\n\n### Environment 1\n\n* Ubuntu 15.04 x86_64\n* Intel Core i5-4210U\n* POCL 0.10\n* SBCL 1.3.1 64-bit\n* Roswell 0.0.3.50\n\n### Environment 2\n\n* Ubuntu 16.04 x86\\_64\n* NVIDIA GeForce GTX 660\n* OpenCL 1.2 CUDA 8.0.20\n* SBCL 1.3.4 64-bit\n* Roswell 0.0.5.59\n\n### Environment 3\n\n* Ubuntu 14.04 x86\\_64\n* AMD Radeon HD 5700 Series\n* OpenCL C 1.2\n* SBCL 1.3.2 64-bit\n* Roswell 0.0.5.58\n\n## Kernel Description Language\n\n### Types\n\nSupport types.\n\n* `char` `char2` `char3` `char4` `char8` `char16`\n* `char*` `char2*` `char3*` `char4*` `char8*` `char16*`\n* `uchar` `uchar2` `uchar3` `uchar4` `uchar8` `uchar16`\n* `uchar*` `uchar2*` `uchar3*` `uchar4*` `uchar8*` `uchar16*`\n* `short` `short2` `short3` `short4` `short8` `short16`\n* `short*` `short2*` `short3*` `short4*` `short8*` `short16*`\n* `ushort` `ushort2` `ushort3` `ushort4` `ushort8` `ushort16`\n* `ushort*` `ushort2*` `ushort3*` `ushort4*` `ushort8*` `ushort16*`\n* `int` `int2` `int3` `int4` `int8` `int16`\n* `int*` `int2*` `int3*` `int4*` `int8*` `int16*`\n* `uint` `uint2` `uint3` `uint4` `uint8` `uint16`\n* `uint*` `uint2*` `uint3*` `uint4*` `uint8*` `uint16*`\n* `long` `long2` `long3` `long4` `long8` `long16`\n* `long*` `long2*` `long3*` `long4*` `long8*` `long16*`\n* `ulong` `ulong2` `ulong3` `ulong4` `ulong8` `ulong16`\n* `ulong*` `ulong2*` `ulong3*` `ulong4*` `ulong8*` `ulong16*`\n* `float` `float2` `float3` `float4` `float8` `float16`\n* `float*` `float2*` `float3*` `float4*` `float8*` `float16*`\n* `double` `double2` `double3` `double4` `double8` `double16`\n* `double*` `double2*` `double3*` `double4*` `double8*` `double16*`\n* `bool` `void` `size-t`\n\n### IF statement\n\n    IF test-form then-form [else-form]\n\n`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.\n\nExample:\n\n    (if (= a 0)\n        (return 0)\n        (return 1))\n\nCompiled:\n\n    if (a == 0) {\n      return 0;\n    } else {\n      return 1;\n    }\n\n### LET statement\n\n    LET ({(var init-form)}*) statement*\n\n`let` declares new variable bindings and set corresponding `init-form`s to them and execute a series of `statement`s that use these bindings. `let` performs the bindings in parallel. For sequentially, use `let*` kernel macro instead.\n\nExample:\n\n    (let ((i 0))\n      (return i))\n\nCompiled:\n\n    {\n      int i = 0;\n      return i;\n    }\n\n### SYMBOL-MACROLET statement\n\n    SYMBOL-MACROLET ({(symbol expansion)}*) statement*\n\n`symbol-macrolet` establishes symbol expansion rules in the variable environment and execute a series of `statement`s that use these rules. In cl-cuda's compilation process, the symbol macros found in a form are replaces by corresponding `expansion`s.\n\nExample:\n\n    (symbol-macrolet ((x 1.0))\n      (return x))\n\nCompiled:\n\n    {\n      return 1.0;\n    }\n\n### DO statement\n\n    DO ({(var init-form step-form)}*) (test-form) statement*\n\n`do` iterates over a group of `statement`s while `test-form` holds. `do` accepts an arbitrary number of iteration `var`s and their initial values are supplied by `init-form`s. `step-form`s supply how the `var`s should be updated on succeeding iterations through the loop.\n\nExample:\n\n    (do ((a 0 (+ a 1))\n         (b 0 (+ b 1)))\n        ((\u003e a 15))\n      (do-some-statement))\n\nCompiled:\n\n    for ( int a = 0, int b = 0; ! (a \u003e 15); a = a + 1, b = b + 1 )\n    {\n      do_some_statement();\n    }\n\n### WITH-LOCAL-MEMORY statement\n\n    WITH-LOCAL-MEMORY ({(var type size*)}*) statement*\n\n`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 `statement`s are executed with these bindings.\n\nExample:\n\n    (with-local-memory ((a int 16)\n                        (b float 16 16))\n      (return))\n\nCompiled:\n\n    {\n      __local int a[16];\n      __local float b[16][16];\n      return;\n    }\n\n### SET statement\n\n    SET reference expression\n\n`set` provides simple variable assignment. It accepts one of variable, structure and array references as `reference`.\n\nExample:\n\n    (set x 1.0)\n    (set (float4-x y 1.0)\n    (set (aref z 0) 1.0)\n\nCompiled:\n\n    x = 1.0;\n    y.x = 1.0;\n    z[0] = 1.0;\n\n### PROGN statement\n\n    PROGN statement*\n\n`progn` evaluates `statement`s, in the order in which they are given.\n\nExample:\n\n    (progn\n      (do-some-statements)\n      (do-more-statements))\n\nCompiled:\n\n    do_some_statements();\n    do_more_statements();\n\n### RETURN statement\n\n    RETURN [return-form]\n\n`return` returns control, with `return-form` if supplied, from a kernel function.\n\nExample:\n\n    (return 0)\n\nCompiled:\n\n    return 0;\n\n### Built in Functions\n\nImplementation status of built in functions.\n\n| Status | Functions |\n|:------:|:----------|\n| Yes    | Work-Item |\n| Part   | Math |\n| Yes    | Integer |\n| Part   | Common |\n| Yes    | Geometric |\n| No     | Relational |\n| No     | Vector Data Load and Store |\n| Yes    | Synchronization |\n| Yes    | Explicit Memory Fence |\n| No     | Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch |\n| Yes    | Atomic |\n| Yes    | Miscellaneous Vector |\n| Yes    | printf |\n| No     | Image Read and Write Functions |\n\n## Author\n\n* gos-k (mag4.elan@gmail.com)\n\nC source generator is forked from [cl-cuda](https://github.com/takagi/cl-cuda).\n\n## Copyright\n\n2015-2025 gos-k (mag4.elan@gmail.com)\n\n### cl-cuda\n\nCopyright (c) 2012 Masayuki Takagi (kamonama@gmail.com)\n\n## License\n\nLicensed under the LLGPL License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgos-k%2Foclcl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgos-k%2Foclcl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgos-k%2Foclcl/lists"}