Skip to content

Instantly share code, notes, and snippets.

@pierremoreau
pierremoreau / CMakeLists.txt
Created April 27, 2018 08:25
Unresolved symbols at link when using Unique handles for extensions objects
# CMake 3.0 is required for the VERSION option to project.
cmake_minimum_required (VERSION 3.0)
# Set the project name and language used.
project ( Test LANGUAGES CXX )
# Vulkan is used for the rendering
find_package (Vulkan REQUIRED)
source ./config.sh
git clone https://github.com/KhronosGroup/SPIRV-Tools ${SPIRVTOOLS_ROOT}
git clone https://github.com/KhronosGroup/SPIRV-Headers.git ${SPIRVTOOLS_ROOT}/external/spirv-headers
mkdir ${SPIRVTOOLS_BUILD} ${SPIRVTOOLS_INSTALL_PREFIX}
cd ${SPIRVTOOLS_BUILD}
cmake -GNinja -DCMAKE_INSTALL_PREFIX="${SPIRVTOOLS_INSTALL_PREFIX}" -DCMAKE_BUILD_TYPE=Release -DSPIRV_BUILD_COMPRESSION=ON ${SPIRVTOOLS_ROOT}
ninja install
git clone -b integrate_with_mesa https://github.com/pierremoreau/llvm-spirv ${LLVMSPIRV_ROOT}
@pierremoreau
pierremoreau / build.sh
Last active February 10, 2018 11:54
Try out SPIR-V support in clover
source ./config.sh
git clone https://github.com/KhronosGroup/SPIRV-Tools ${SPIRVTOOLS_ROOT}
git clone https://github.com/KhronosGroup/SPIRV-Headers.git ${SPIRVTOOLS_ROOT}/external/spirv-headers
mkdir ${SPIRVTOOLS_BUILD} ${SPIRVTOOLS_INSTALL_PREFIX}
cd ${SPIRVTOOLS_BUILD}
cmake -GNinja -DCMAKE_INSTALL_PREFIX="${SPIRVTOOLS_INSTALL_PREFIX}" -DCMAKE_BUILD_TYPE=Release -DSPIRV_BUILD_COMPRESSION=ON ${SPIRVTOOLS_ROOT}
ninja install
git clone -b integrate_with_mesa https://github.com/pierremoreau/llvm-spirv ${LLVMSPIRV_ROOT}
@pierremoreau
pierremoreau / init.vim
Created October 31, 2016 09:45
Neovim config file
" Vim Configuration File
" Author: Pierre Moreau <dev@pmoreau.org>
" Disable Vi compatibility
set nocompatible
" Set beginning of statusline
set statusline=%<%f\ %h%m%r\ \
# Generated by YCM Generator at 2016-07-28 23:44:58.433313
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
@pierremoreau
pierremoreau / Command + Output
Created July 30, 2016 16:26
Compiling CUDA kernel which uses `surf2Dwrite()`
% clang++ --cuda-path=/opt/cuda --cuda-gpu-arch=sm_30 -std=c++14 -I/opt/cuda/include surface.cu -o surf -L/opt/cuda/lib64 -lcudart_static -ldl -lrt -pthread
surface.cu:15:3: error: use of undeclared identifier 'surf2Dwrite'
surf2Dwrite(make_float4(0.0f, 0.0f, 0.0f, 1.0f), result_surface, index.x * sizeof(float4), index.y);
^
1 error generated.
@pierremoreau
pierremoreau / .ycm_extra_conf.py
Created July 29, 2016 08:55
CUDA Sample Code
# Generated by YCM Generator at 2016-07-28 23:44:58.433313
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or