Coder Social home page Coder Social logo

sibnick / vc4c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from doe300/vc4c

0.0 2.0 0.0 11.58 MB

Compiler for the VC4CL OpenCL implementation

License: MIT License

CMake 0.07% C 94.71% C++ 5.03% Shell 0.01% Objective-C 0.14% Cool 0.04% LLVM 0.01%

vc4c's Introduction

VC4C

Compiler for the VC4CL OpenCL-implementation. This compiler supports OpenCL C (via LLVM or SPIRV-LLVM), LLVM-IR and SPIR-V code, depending on the build configuration.

Required software

  • A C++11 capable compiler
  • CMake in version >= 3.1
  • A suitable OpenCL 1.2 compiler. Supported versions are the "original" LLVM/CLang, which can be found in the Raspbian repositories, and Khronos SPIRV-LLVM with the Khronos SPIR-V compiler frontend (only the tools clang and llvm-spirv need to be built).
  • The source-code for VC4CLStdLib for the GPU-side standard-library

Build

The following configuration variables can be set in CMake:

  • BUILD_TESTING toggles building of test program
  • BUILD_DEBUG toggles building debug or release program
  • MULTI_THREADED toggles building with multi-threaded support
  • VERIFY_OUTPUT toggles the usage of vc4asm to validate the generated machine code
  • LLVMIR_FRONTEND toggles building of the LLVM-IR frontend, requires an installed CLang compiler (LLVM or SPIRV-LLVM)
  • VC4CL_STDLIB_HEADER_SOURCE sets the headers for the GPU-side VC4CLStdLib, defaults to ../VC4CLStdLib/include/VC4CLStdLib.h
  • CROSS_COMPILE toggles whether to cross-compile for the Raspberry Pi, requires the Raspberry Pi cross-compiler to be installed
  • CROSS_COMPILER_PATH sets the root path to the Raspberry Pi cross compiler, defaults to /opt/rasperrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64 (e.g. for the cross compiler cloned into the directory /opt/raspberrypi/tools/)
  • SPIRV_FRONTEND toggles building of the SPIR-V frontend, requires SPIRV-LLVM
  • SPIRV_COMPILER_ROOT sets the root-path to binaries of the SPIRV-LLVM compiler, defaults to /opt/SPIRV-LLVM/build/bin/

Known Issues

If the VC4CLStdLib is updated, the LLVM precompiled header (PCH) needs to be rebuilt. For this to happen, simply delete the file include/VC4CLStdLib.h.pch and rebuild the VC4C compiler (or just the vc4cl-stdlib target).

Sometimes, at least on my Raspberry Pi, if a compilation fails, it somehow removes the symbolic /dev/stdout to the current process' standard output, resulting in no program can write to stdout anymore!! To remedy, restart the Pi.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.