Skip to content

Instantly share code, notes, and snippets.

View ginkgo's full-sized avatar

Thomas Weber ginkgo

  • Trondheim, Norway
View GitHub Profile
void krnl1_fn(__global int* A,
local int* l)
{
if (get_local_id(0)==0) {
*l = A[get_global_id(0)];
}
barrier(CLK_LOCAL_MEM_FENCE);
#include <iostream>
#include <vector>
#include <fstream>
#include <assert.h>
using std::cout;
using std::cerr;
using std::endl;
using std::string;
Number of platforms: 2
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 2.0 AMD-APP (1598.5)
Platform Name: AMD Accelerated Parallel Processing
Platform Vendor: Advanced Micro Devices, Inc.
Platform Extensions: cl_khr_icd cl_amd_event_callback cl_amd_offline_devices
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 1.2 LINUX
Platform Name: Intel(R) OpenCL
Platform Vendor: Intel(R) Corporation
#include <iostream>
#include <vector>
#include <fstream>
using std::cout;
using std::cerr;
using std::endl;
using std::string;
using std::vector;
#!/bin/env python3
import re
import math
import urllib.request as urllib
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
def parse_top_colors(file):
#define BATCH_SIZE 64
kernel void bound_n_split(...
global int* debug_flags)
{
...
const size_t lid = get_local_id(0);
const size_t wid = get_group_id(0);
diff --git a/premake4.lua b/premake4.lua
index 2c59ecf..86a5d5e 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -105,6 +105,7 @@ solution "oclraster"
add_include("/usr/include/w32api/GL")
end
add_include("/usr/local/include")
+ add_include("/usr/local/include/floor")
add_include("/usr/include/libxml2")
int hash(int i)
{
return (int)((i*2654435761L) & 0xffffffffffffffffL);
}
float fhash(int i)
{
return (float)hash(i) * pow(2., -32.);
}
#include "stdio.h"
int main(void)
{
int i = 1;
for (;;) {
printf("%d\n", i++); // 1
printf("%d\n", i++); // 2
printf("fizz\n", i++); // 3