Brahma.FSharp.OpenCL.Translator 2.0.0-alpha9.6

This is a prerelease version of Brahma.FSharp.OpenCL.Translator.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Brahma.FSharp.OpenCL.Translator --version 2.0.0-alpha9.6
NuGet\Install-Package Brahma.FSharp.OpenCL.Translator -Version 2.0.0-alpha9.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Brahma.FSharp.OpenCL.Translator" Version="2.0.0-alpha9.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Brahma.FSharp.OpenCL.Translator --version 2.0.0-alpha9.6
#r "nuget: Brahma.FSharp.OpenCL.Translator, 2.0.0-alpha9.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Brahma.FSharp.OpenCL.Translator as a Cake Addin
#addin nuget:?package=Brahma.FSharp.OpenCL.Translator&version=2.0.0-alpha9.6&prerelease

// Install Brahma.FSharp.OpenCL.Translator as a Cake Tool
#tool nuget:?package=Brahma.FSharp.OpenCL.Translator&version=2.0.0-alpha9.6&prerelease


FAKE Build NuGet Badge NuGet Badge License

Brahma.FSharp provides a way to utilize GPGPU in your F# programs. It is based on F# quotations to OpenCL translation.


  • Utilization of OpenCL for communication with GPU. So, you can work not only with NVIDIA devices but with any device which supports OpenCL (e.g. with AMD ot Intel devices).
  • Not only primitive types, but also discriminated unions, structs, records are supported.
  • Pattern matching, mutable and immutable bindings, nested bindings are supported.
  • Fine-grained memory management and kernels compilation process.
  • Mailbox processor based interface for communication with devices.

More details are available here. Examples of usage are available here.


Install Brahma.FSharp by running:

dotnet add package Brahma.FSharp

Quick Start

open Brahma.FSharp

let device = ClDevice.GetFirstAppropriateDevice()
let context = RuntimeContext(device)

let kernel =
        fun (range: Range1D) (buffer: int clarray) ->
            let gid = range.GlobalID0
            buffer.[gid] <- buffer.[gid] + 1

opencl {
    use! buffer = ClArray.alloc<int> 1024
    do! runCommand kernel <| fun kernel ->
        <| Range1D(1024, 256)
        <| buffer

    return! ClArray.toHost buffer
|> ClTask.runSync context


Contributions, issues and feature requests are welcome. Feel free to check issues page if you want to contribute.


Make sure the following requirements are installed on your system:

  • dotnet SDK 5.0 or higher
  • OpenCL-compatible device and respective OpenCL driver

To build and run all tests:

  • on Windows
  • on Linux/macOS

To find more options look at MiniScaffold.


This project licensed under EPL-1.0 License. License text can be found in the license file.


Setup BRAHMA_OCL_PATH environment variable

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Brahma.FSharp.OpenCL.Translator:

Package Downloads

Core components of Brahma.FSharp.


OpenCL C printer: from AST to text.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.0-alpha1.5 167 4/17/2024
3.0.0-alpha1.3 53 4/12/2024
3.0.0-alpha1.2 45 4/12/2024
3.0.0-alpha1.1 51 4/9/2024
2.0.5 2,545 2/10/2023
2.0.4 859 1/13/2023
2.0.3 1,030 1/4/2023
2.0.2 834 12/28/2022
2.0.1 3,959 8/5/2022
2.0.0 1,326 7/5/2022
2.0.0-alpha9.6 173 6/3/2022
2.0.0-alpha9.5 137 5/7/2022
2.0.0-alpha9.4 144 4/8/2022
2.0.0-alpha9.3 132 3/24/2022
2.0.0-alpha9.2 1,342 11/26/2021
2.0.0-alpha9.1 317 10/16/2021
2.0.0-alpha9 690 10/15/2021
2.0.0-alpha8 724 9/27/2021
2.0.0-alpha7.1 174 7/18/2021
2.0.0-alpha7 755 5/19/2021
2.0.0-alpha6.2 223 5/19/2021
2.0.0-alpha6.1 260 3/22/2021
2.0.0-alpha6 772 3/22/2021
2.0.0-alpha5 933 1/27/2021
2.0.0-alpha4 858 12/27/2020
2.0.0-alpha3 922 11/27/2020
2.0.0-alpha2 965 11/11/2020

## [2.0.0-alpha9.6] - 2022-06-03


### Fixed
- Blittable types transfer
- Performance issues