Skip to content

Instantly share code, notes, and snippets.

@jrprice
jrprice / oclc.c
Created April 14, 2015 10:39
Simple command-line OpenCL C compiler.
#include <CL/cl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
cl_int err;
cl_platform_id platform;
cl_device_id device;
@jrprice
jrprice / strided_buffer_to_image.c
Last active September 1, 2017 03:40
Benchmark for different methods of copying strided data from a buffer to an image using OpenCL
#include <assert.h>
#include <stdio.h>
#include <sys/time.h>
#include <CL/cl.h>
// Platform and device indices to use
#define PLATFORM 0
#define DEVICE 0