Skip to content

Instantly share code, notes, and snippets.

@nbigaouette nbigaouette/Makefile

Created Apr 27, 2011
Embed
What would you like to do?
AMD Stream OpenCL bug?
// #pragma OPENCL EXTENSION cl_amd_printf : enable
__kernel void Test_OpenCL(__global const float * const a,
__global float * const b)
{
unsigned int i = get_global_id(0);
//printf("i = %3u ", i);
b[i] = a[i] + b[i];
//printf("a[i] = %g ", a[i]);
//printf("b[i] = %g\n", b[i]);
}
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <CL/cl.h>
// g++ main.cpp -o opencl_test -lOpenCL
// while [ 1 ]; do pidof -x opencl_test | xargs ps u -p | tail -1 | awk '{print ""$6" KiB "$6/1024" MiB "$6/1024**2" GiB"}' ; sleep 0 ;done 2> /dev/null
#define OpenCL_Test_Init_Error(err, fct_name) \
if ((err) != CL_SUCCESS) \
{ \
printf("ERROR at %s (%s line %s): %d\n", fct_name, __FILE__, __LINE__, err); \
abort(); \
}
bool gpu_present;
int n;
float *a;
float *b;
// Array to work on
cl_mem cl_a;
cl_mem cl_b;
// N dimensional array of workgroup size we must pass to the kernel
size_t workGroupSize[1];
// Handles for creating an OpenCL context
cl_platform_id platform;
// Device variables
cl_device_id* devices;
cl_uint numDevices;
unsigned int deviceUsed;
cl_context context;
cl_command_queue command_queue;
cl_program program;
cl_kernel kernel;
// Debugging variables
cl_int err;
cl_event event;
char *read_opencl_kernel(const char filename[], int *length)
{
FILE *f = fopen(filename, "r");
void *buffer;
if (!f) {
printf("Unable to open %s for reading\n", filename);
abort();
}
fseek(f, 0, SEEK_END);
*length = ftell(f);
fseek(f, 0, SEEK_SET);
buffer = malloc(*length+1);
*length = fread(buffer, 1, *length, f);
fclose(f);
((char*)buffer)[*length] = '\0';
return (char*)buffer;
}
int main(int argc, char *argv[])
{
const int n = 10;
float *a = (float *) calloc(n, sizeof(float));
float *b = (float *) calloc(n, sizeof(float));
float *c = (float *) calloc(n, sizeof(float));
for (int i = 0 ; i < n ; i++)
{
a[i] = float(i);
b[i] = float(10*i);
// Make sure this operation is the same as the kernel's!
c[i] = a[i] + b[i];
}
printf("Initial vector values:\n");
for (int i = 0 ; i < n ; i++)
{
printf("a[i=%d] = %9f b[i=%d] = %9f c[i=%d] = %9f\n", i, a[i], i, b[i], i, c[i]);
}
printf("Initializing OpenCL...\n");
{
gpu_present = true;
err = clGetPlatformIDs(1, &platform, NULL);
OpenCL_Test_Init_Error(err, "oclGetPlatformID");
// Get the number of GPU devices available to the platform
// we should probably expose the device type to the user
// the other common option is CL_DEVICE_TYPE_CPU
err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, NULL, &numDevices);
if (err == CL_DEVICE_NOT_FOUND)
{
printf("WARNING: Can't find a GPU. Trying a CPU...\n");
gpu_present = false;
err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL, &numDevices);
}
OpenCL_Test_Init_Error(err, "0 clGetDeviceIDs");
// Create the device list
devices = new cl_device_id[numDevices];
if (gpu_present)
err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numDevices, devices, NULL);
else
err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, numDevices, devices, NULL);
OpenCL_Test_Init_Error(err, "1 clGetDeviceIDs");
// FIXME: For right now we just use the first available device.
deviceUsed = 0;
// Create the context
context = clCreateContext(NULL, 1, &devices[deviceUsed], NULL, NULL, &err);
if (err == CL_DEVICE_NOT_FOUND)
{
printf("WARNING: Can't find an OpenCL device!\n");
abort();
}
OpenCL_Test_Init_Error(err, "clCreateContext");
// Create the command queue we will use to execute OpenCL commands
command_queue = clCreateCommandQueue(context, devices[deviceUsed], 0, &err);
OpenCL_Test_Init_Error(err, "clCreateCommandQueue");
// **********************************************************
// Load and build the kernel
// Program Setup
int pl;
size_t program_length;
// Loads the contents of the file at the given path
char* cSourceCL = read_opencl_kernel("kernel.cl", &pl);
program_length = (size_t) pl;
// create the program
program = clCreateProgramWithSource(context, 1,
(const char **) &cSourceCL, &program_length, &err);
OpenCL_Test_Init_Error(err, "clCreateProgramWithSource");
err = clBuildProgram(program, 0, NULL, "-g", NULL, NULL);
if (err != CL_SUCCESS)
{
cl_build_status build_status;
err = clGetProgramBuildInfo(program, devices[deviceUsed], CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status), &build_status, NULL);
OpenCL_Test_Init_Error(err, "0. clGetProgramBuildInfo");
char *build_log;
size_t ret_val_size;
err = clGetProgramBuildInfo(program, devices[deviceUsed], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size);
OpenCL_Test_Init_Error(err, "1. clGetProgramBuildInfo");
build_log = new char[ret_val_size+1];
err = clGetProgramBuildInfo(program, devices[deviceUsed], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);
build_log[ret_val_size] = '\0';
OpenCL_Test_Init_Error(err, "2. clGetProgramBuildInfo");
printf("Build log: \n%s\n", build_log);
printf("Kernel did not built correctly. Exiting.\n");
abort();
}
// Initialize our kernel from the program
// The function name HAVE to match!
kernel = clCreateKernel(program, "Test_OpenCL", &err);;
OpenCL_Test_Init_Error(err, "clCreateKernel");
// For now we make the workgroup size the same as the number of elements in our arrays
workGroupSize[0] = n;
// **********************************************************
cl_a = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof(float) * n, NULL, &err);
OpenCL_Test_Init_Error(err, "0. clCreateBuffer");
cl_b = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(float) * n, NULL, &err);
OpenCL_Test_Init_Error(err, "1. clCreateBuffer");
err = clFinish(command_queue);
OpenCL_Test_Init_Error(err, "clFinish");
// **********************************************************
err = clEnqueueWriteBuffer(command_queue, cl_a, CL_TRUE, 0, sizeof(float) * n, a, 0, NULL, &event);
OpenCL_Test_Init_Error(err, "clEnqueueWriteBuffer");
err = clEnqueueWriteBuffer(command_queue, cl_b, CL_TRUE, 0, sizeof(float) * n, b, 0, NULL, &event);
OpenCL_Test_Init_Error(err, "clEnqueueWriteBuffer");
err = clFinish(command_queue);
OpenCL_Test_Init_Error(err, "clFinish");
// **********************************************************
int ci = 0;
err = clSetKernelArg(kernel, ci++, sizeof(cl_mem), (void *) &cl_a);
err |= clSetKernelArg(kernel, ci++, sizeof(cl_mem), (void *) &cl_b);
OpenCL_Test_Init_Error(err, "clSetKernelArg");
// Wait for the command queue to finish these commands before proceeding
err = clFinish(command_queue);
OpenCL_Test_Init_Error(err, "clFinish");
// **********************************************************
}
printf("Clear b on host:\n");
for (int i = 0 ; i < n ; i++)
{
// Set b to 0, so read from GPU memory is verified
b[i] = 0.0;
printf("a[i=%d] = %9f b[i=%d] = %9f c[i=%d] = %9f\n", i, a[i], i, b[i], i, c[i]);
}
// **********************************************************
printf("Execute OpenCL kernel...\n");
for (int i = 0 ; i < 1000000 ; i++)
{
err = clEnqueueNDRangeKernel(command_queue, kernel, 1, NULL, workGroupSize, NULL, 0, NULL, &event);
OpenCL_Test_Init_Error(err, "clEnqueueNDRangeKernel");
err = clFinish(command_queue);
OpenCL_Test_Init_Error(err, "clFinish");
}
// **********************************************************
// **********************************************************
printf("Read back to host memory...\n");
err = clEnqueueReadBuffer(command_queue, cl_b, CL_TRUE, 0, n * sizeof(float), b, 0, NULL, NULL);
OpenCL_Test_Init_Error(err, "clEnqueueReadBuffer");
err = clFinish(command_queue);
OpenCL_Test_Init_Error(err, "clFinish");
// **********************************************************
printf("New vector values:\n");
for (int i = 0 ; i < n ; i++)
{
printf("a[i=%d] = %9f b[i=%d] = %9f c[i=%d] = %9f\n", i, a[i], i, b[i], i, c[i]);
// Verify b against c
assert(std::abs(c[i] - b[i]) < 1.0e-5);
}
printf("Success! c == b\n");
free(a);
free(b);
free(c);
return EXIT_SUCCESS;
}
# while [ 1 ]; do pidof -x opencl_test | xargs ps u -p | tail -1 | awk '{print ""$6" KiB "$6/1024" MiB "$6/1024**2" GiB"}' ; sleep 0 ;done 2> /dev/null
BIN = opencl_test
a: all
all : $(BIN)
$(BIN): main.cpp
g++ -g main.cpp -o opencl_test -lOpenCL
c: clean
clean:
rm -f $(BIN)
r: run
run: $(BIN)
./$(BIN)
mem:
while [ 1 ]; do pidof -x $(BIN) | xargs ps u -p | tail -1 | awk '{print ""$6" KiB "$6/1024" MiB "$6/1024**2" GiB"}' ; sleep 0 ;done 2> /dev/null
Process 18591 - opencl_test
Summary
The process opencl_test (with pid 18591) is using approximately 239.0 MB of memory.
It is using 239.0 MB privately, and a further 1748.0 KB that is, or could be, shared with other programs.
Dividing up the shared memory between all the processes sharing that memory we get a reduced shared memory usage of 85.0 KB. Adding that to the private usage, we get the above mentioned total memory footprint of 239.0 MB.
Library Usage
The memory usage of a process is found by adding up the memory usage of each of its libraries, plus the process's own heap, stack and any other mappings, plus the stack of its 5 threads.
Private
hide
233828 KB [heap]
10472 KB /opt/amdstream/lib/x86_64/libamdocl64.so
96 KB [stack]
60 KB /usr/lib/libGL.so.1.2
44 KB /usr/lib/libstdc++.so.6.0.16
24 KB /usr/lib/libX11.so.6.3.0
20 KB /opt/amdstream/lib/x86_64/libOpenCL.so.1
20 KB /lib/libc-2.13.so
16 KB /home/nicolas/fichiers/documents/universite/doc/code/projects/945170/opencl_test
16 KB /lib/libm-2.13.so
16 KB /usr/lib/libxcb-glx.so.0.0.0
8 KB /lib/ld-2.13.so
8 KB /lib/libpthread-2.13.so
8 KB /lib/libdl-2.13.so
8 KB /lib/librt-2.13.so
8 KB /tmp/OCLuz6n0a.so
4 KB /usr/lib/libgcc_s.so.1
4 KB /usr/lib/libXext.so.6.4.0
4 KB /usr/lib/libXdamage.so.1.1.0
4 KB /usr/lib/libXfixes.so.3.1.0
4 KB /usr/lib/libXxf86vm.so.1.0.0
4 KB /usr/lib/libX11-xcb.so.1.0.0
4 KB /usr/lib/libxcb.so.1.1.0
4 KB /usr/lib/libdrm.so.2.4.0
4 KB /usr/lib/libXau.so.6.0.0
4 KB /usr/lib/libXdmcp.so.6.0.0
Shared
hide
540 KB /usr/lib/libstdc++.so.6.0.16
520 KB /lib/libc-2.13.so
148 KB /usr/lib/libGL.so.1.2
116 KB /usr/lib/libX11.so.6.3.0
112 KB /lib/ld-2.13.so
72 KB /lib/libpthread-2.13.so
40 KB /usr/lib/libxcb.so.1.1.0
32 KB /lib/libm-2.13.so
32 KB /usr/lib/libxcb-glx.so.0.0.0
20 KB /lib/librt-2.13.so
20 KB /usr/lib/libXext.so.6.4.0
16 KB /usr/lib/libgcc_s.so.1
16 KB /usr/lib/libdrm.so.2.4.0
12 KB /usr/lib/libXfixes.so.3.1.0
12 KB /usr/lib/libXdmcp.so.6.0.0
8 KB /lib/libdl-2.13.so
8 KB /usr/lib/libXdamage.so.1.1.0
8 KB /usr/lib/libXxf86vm.so.1.0.0
8 KB /usr/lib/libXau.so.6.0.0
4 KB /usr/lib/libX11-xcb.so.1.0.0
4 KB [vdso]
Totals
Private 244692 KB (= 9992 KB clean + 234700 KB dirty)
Shared 1748 KB (= 1748 KB clean + 0 KB dirty)
Rss 246440 KB (= Private + Shared)
Pss 244777 KB (= Private + Shared/Number of Processes)
Swap 0 KB
Full Details
Information about the complete virtual space for the process is available, with sortable columns. An empty filename means that it is an anonymous mapping.
Both the MMU page size and the kernel page size are 4 KB.
Address Perm Size Rss Pss Shared Clean Shared Dirty Private Clean Private Dirty Referenced Anonymous Swap Locked Filename
00400000-00403000 r-xp 12 KB 12 KB 12 KB 0 KB 0 KB 12 KB 0 KB 12 KB 0 KB 0 KB 0 KB /home/nicolas/fichiers/documents/universite/doc/code/projects/945170/opencl_test
00602000-00603000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /home/nicolas/fichiers/documents/universite/doc/code/projects/945170/opencl_test
01713000-09453000 rw-p 128256 KB 128148 KB 128148 KB 0 KB 0 KB 0 KB 128148 KB 128148 KB 128148 KB 0 KB 0 KB [heap]
2b0a289b2000-2b0a289d0000 r-xp 120 KB 112 KB 1 KB 112 KB 0 KB 0 KB 0 KB 112 KB 0 KB 0 KB 0 KB /lib/ld-2.13.so
2b0a289d0000-2b0a289d2000 rw-p 8 KB 8 KB 8 KB 0 KB 0 KB 0 KB 8 KB 8 KB 8 KB 0 KB 0 KB
2b0a289d2000-2b0a289d3000 ---p 4 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB
2b0a289d3000-2b0a28a13000 rw-p 256 KB 8 KB 8 KB 0 KB 0 KB 0 KB 8 KB 8 KB 8 KB 0 KB 0 KB
2b0a28bcf000-2b0a28bd0000 r--p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/ld-2.13.so
2b0a28bd0000-2b0a28bd1000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/ld-2.13.so
2b0a28bd1000-2b0a28bd2000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB
2b0a28bd2000-2b0a28bd7000 r-xp 20 KB 16 KB 16 KB 0 KB 0 KB 16 KB 0 KB 16 KB 0 KB 0 KB 0 KB /opt/amdstream/lib/x86_64/libOpenCL.so.1
2b0a28bd7000-2b0a28dd6000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /opt/amdstream/lib/x86_64/libOpenCL.so.1
2b0a28dd6000-2b0a28dd7000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /opt/amdstream/lib/x86_64/libOpenCL.so.1
2b0a28dd7000-2b0a28ec2000 r-xp 940 KB 544 KB 37 KB 540 KB 0 KB 4 KB 0 KB 544 KB 0 KB 0 KB 0 KB /usr/lib/libstdc++.so.6.0.16
2b0a28ec2000-2b0a290c2000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libstdc++.so.6.0.16
2b0a290c2000-2b0a290ca000 r--p 32 KB 32 KB 32 KB 0 KB 0 KB 0 KB 32 KB 32 KB 32 KB 0 KB 0 KB /usr/lib/libstdc++.so.6.0.16
2b0a290ca000-2b0a290cc000 rw-p 8 KB 8 KB 8 KB 0 KB 0 KB 0 KB 8 KB 8 KB 8 KB 0 KB 0 KB /usr/lib/libstdc++.so.6.0.16
2b0a290cc000-2b0a290e2000 rw-p 88 KB 16 KB 16 KB 0 KB 0 KB 0 KB 16 KB 16 KB 16 KB 0 KB 0 KB
2b0a290e2000-2b0a29163000 r-xp 516 KB 40 KB 9 KB 32 KB 0 KB 8 KB 0 KB 40 KB 0 KB 0 KB 0 KB /lib/libm-2.13.so
2b0a29163000-2b0a29362000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /lib/libm-2.13.so
2b0a29362000-2b0a29363000 r--p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/libm-2.13.so
2b0a29363000-2b0a29364000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/libm-2.13.so
2b0a29364000-2b0a29379000 r-xp 84 KB 16 KB 0 KB 16 KB 0 KB 0 KB 0 KB 16 KB 0 KB 0 KB 0 KB /usr/lib/libgcc_s.so.1
2b0a29379000-2b0a29579000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libgcc_s.so.1
2b0a29579000-2b0a2957a000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libgcc_s.so.1
2b0a2957a000-2b0a296ce000 r-xp 1360 KB 520 KB 8 KB 520 KB 0 KB 0 KB 0 KB 520 KB 0 KB 0 KB 0 KB /lib/libc-2.13.so
2b0a296ce000-2b0a298ce000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /lib/libc-2.13.so
2b0a298ce000-2b0a298d2000 r--p 16 KB 16 KB 16 KB 0 KB 0 KB 0 KB 16 KB 16 KB 16 KB 0 KB 0 KB /lib/libc-2.13.so
2b0a298d2000-2b0a298d3000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/libc-2.13.so
2b0a298d3000-2b0a298d9000 rw-p 24 KB 20 KB 20 KB 0 KB 0 KB 0 KB 20 KB 20 KB 20 KB 0 KB 0 KB
2b0a298d9000-2b0a298f0000 r-xp 92 KB 72 KB 1 KB 72 KB 0 KB 0 KB 0 KB 72 KB 0 KB 0 KB 0 KB /lib/libpthread-2.13.so
2b0a298f0000-2b0a29af0000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /lib/libpthread-2.13.so
2b0a29af0000-2b0a29af1000 r--p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/libpthread-2.13.so
2b0a29af1000-2b0a29af2000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/libpthread-2.13.so
2b0a29af2000-2b0a29af6000 rw-p 16 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB
2b0a29af6000-2b0a29af8000 r-xp 8 KB 8 KB 0 KB 8 KB 0 KB 0 KB 0 KB 8 KB 0 KB 0 KB 0 KB /lib/libdl-2.13.so
2b0a29af8000-2b0a29cf8000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /lib/libdl-2.13.so
2b0a29cf8000-2b0a29cf9000 r--p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/libdl-2.13.so
2b0a29cf9000-2b0a29cfa000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/libdl-2.13.so
2b0a29cfa000-2b0a29cfe000 rw-p 16 KB 16 KB 16 KB 0 KB 0 KB 0 KB 16 KB 16 KB 16 KB 0 KB 0 KB
2b0a29cfe000-2b0a2aeab000 r-xp 18100 KB 9936 KB 9936 KB 0 KB 0 KB 9936 KB 0 KB 9936 KB 0 KB 0 KB 0 KB /opt/amdstream/lib/x86_64/libamdocl64.so
2b0a2aeab000-2b0a2b0aa000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /opt/amdstream/lib/x86_64/libamdocl64.so
2b0a2b0aa000-2b0a2b130000 rw-p 536 KB 536 KB 536 KB 0 KB 0 KB 0 KB 536 KB 536 KB 536 KB 0 KB 0 KB /opt/amdstream/lib/x86_64/libamdocl64.so
2b0a2b130000-2b0a2b195000 rw-p 404 KB 392 KB 392 KB 0 KB 0 KB 0 KB 392 KB 392 KB 392 KB 0 KB 0 KB
2b0a2b195000-2b0a2b1ff000 r-xp 424 KB 152 KB 33 KB 148 KB 0 KB 4 KB 0 KB 152 KB 0 KB 0 KB 0 KB /usr/lib/libGL.so.1.2
2b0a2b1ff000-2b0a2b3fe000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libGL.so.1.2
2b0a2b3fe000-2b0a2b40c000 rw-p 56 KB 56 KB 56 KB 0 KB 0 KB 0 KB 56 KB 56 KB 56 KB 0 KB 0 KB /usr/lib/libGL.so.1.2
2b0a2b40c000-2b0a2b40e000 rw-p 8 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB
2b0a2b40e000-2b0a2b547000 r-xp 1252 KB 116 KB 3 KB 116 KB 0 KB 0 KB 0 KB 116 KB 0 KB 0 KB 0 KB /usr/lib/libX11.so.6.3.0
2b0a2b547000-2b0a2b747000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libX11.so.6.3.0
2b0a2b747000-2b0a2b74d000 rw-p 24 KB 24 KB 24 KB 0 KB 0 KB 0 KB 24 KB 24 KB 24 KB 0 KB 0 KB /usr/lib/libX11.so.6.3.0
2b0a2b74d000-2b0a2b754000 r-xp 28 KB 20 KB 0 KB 20 KB 0 KB 0 KB 0 KB 20 KB 0 KB 0 KB 0 KB /lib/librt-2.13.so
2b0a2b754000-2b0a2b953000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /lib/librt-2.13.so
2b0a2b953000-2b0a2b954000 r--p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/librt-2.13.so
2b0a2b954000-2b0a2b955000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /lib/librt-2.13.so
2b0a2b955000-2b0a2b966000 r-xp 68 KB 20 KB 0 KB 20 KB 0 KB 0 KB 0 KB 20 KB 0 KB 0 KB 0 KB /usr/lib/libXext.so.6.4.0
2b0a2b966000-2b0a2bb66000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libXext.so.6.4.0
2b0a2bb66000-2b0a2bb67000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libXext.so.6.4.0
2b0a2bb67000-2b0a2bb69000 r-xp 8 KB 8 KB 0 KB 8 KB 0 KB 0 KB 0 KB 8 KB 0 KB 0 KB 0 KB /usr/lib/libXdamage.so.1.1.0
2b0a2bb69000-2b0a2bd68000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libXdamage.so.1.1.0
2b0a2bd68000-2b0a2bd69000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libXdamage.so.1.1.0
2b0a2bd69000-2b0a2bd6e000 r-xp 20 KB 12 KB 0 KB 12 KB 0 KB 0 KB 0 KB 12 KB 0 KB 0 KB 0 KB /usr/lib/libXfixes.so.3.1.0
2b0a2bd6e000-2b0a2bf6e000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libXfixes.so.3.1.0
2b0a2bf6e000-2b0a2bf6f000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libXfixes.so.3.1.0
2b0a2bf6f000-2b0a2bf74000 r-xp 20 KB 8 KB 1 KB 8 KB 0 KB 0 KB 0 KB 8 KB 0 KB 0 KB 0 KB /usr/lib/libXxf86vm.so.1.0.0
2b0a2bf74000-2b0a2c173000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libXxf86vm.so.1.0.0
2b0a2c173000-2b0a2c174000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libXxf86vm.so.1.0.0
2b0a2c174000-2b0a2c175000 r-xp 4 KB 4 KB 0 KB 4 KB 0 KB 0 KB 0 KB 4 KB 0 KB 0 KB 0 KB /usr/lib/libX11-xcb.so.1.0.0
2b0a2c175000-2b0a2c374000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libX11-xcb.so.1.0.0
2b0a2c374000-2b0a2c375000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libX11-xcb.so.1.0.0
2b0a2c375000-2b0a2c387000 r-xp 72 KB 40 KB 14 KB 32 KB 0 KB 8 KB 0 KB 40 KB 0 KB 0 KB 0 KB /usr/lib/libxcb-glx.so.0.0.0
2b0a2c387000-2b0a2c587000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libxcb-glx.so.0.0.0
2b0a2c587000-2b0a2c589000 rw-p 8 KB 8 KB 8 KB 0 KB 0 KB 0 KB 8 KB 8 KB 8 KB 0 KB 0 KB /usr/lib/libxcb-glx.so.0.0.0
2b0a2c589000-2b0a2c5a4000 r-xp 108 KB 40 KB 1 KB 40 KB 0 KB 0 KB 0 KB 40 KB 0 KB 0 KB 0 KB /usr/lib/libxcb.so.1.1.0
2b0a2c5a4000-2b0a2c7a3000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libxcb.so.1.1.0
2b0a2c7a3000-2b0a2c7a4000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libxcb.so.1.1.0
2b0a2c7a4000-2b0a2c7ae000 r-xp 40 KB 16 KB 1 KB 16 KB 0 KB 0 KB 0 KB 16 KB 0 KB 0 KB 0 KB /usr/lib/libdrm.so.2.4.0
2b0a2c7ae000-2b0a2c9ae000 ---p 2048 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libdrm.so.2.4.0
2b0a2c9ae000-2b0a2c9af000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libdrm.so.2.4.0
2b0a2c9af000-2b0a2c9b1000 r-xp 8 KB 8 KB 0 KB 8 KB 0 KB 0 KB 0 KB 8 KB 0 KB 0 KB 0 KB /usr/lib/libXau.so.6.0.0
2b0a2c9b1000-2b0a2cbb0000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libXau.so.6.0.0
2b0a2cbb0000-2b0a2cbb1000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libXau.so.6.0.0
2b0a2cbb1000-2b0a2cbb6000 r-xp 20 KB 12 KB 0 KB 12 KB 0 KB 0 KB 0 KB 12 KB 0 KB 0 KB 0 KB /usr/lib/libXdmcp.so.6.0.0
2b0a2cbb6000-2b0a2cdb5000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /usr/lib/libXdmcp.so.6.0.0
2b0a2cdb5000-2b0a2cdb6000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /usr/lib/libXdmcp.so.6.0.0
2b0a2cdb6000-2b0a2cdb7000 ---p 4 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB
2b0a2cdb7000-2b0a2d5c8000 rw-p 8260 KB 12 KB 12 KB 0 KB 0 KB 0 KB 12 KB 12 KB 12 KB 0 KB 0 KB
2b0a2d5c8000-2b0a2d5c9000 ---p 4 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB
2b0a2d5c9000-2b0a2ddda000 rw-p 8260 KB 12 KB 12 KB 0 KB 0 KB 0 KB 12 KB 12 KB 12 KB 0 KB 0 KB
2b0a2ddda000-2b0a2dddb000 ---p 4 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB
2b0a2dddb000-2b0a2e5ec000 rw-p 8260 KB 12 KB 12 KB 0 KB 0 KB 0 KB 12 KB 12 KB 12 KB 0 KB 0 KB
2b0a2e5ec000-2b0a2e5ed000 ---p 4 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB
2b0a2e5ed000-2b0a2edfe000 rw-p 8260 KB 12 KB 12 KB 0 KB 0 KB 0 KB 12 KB 12 KB 12 KB 0 KB 0 KB
2b0a2edfe000-2b0a2edff000 r-xp 4 KB 4 KB 4 KB 0 KB 0 KB 4 KB 0 KB 4 KB 0 KB 0 KB 0 KB /tmp/OCLuz6n0a.so
2b0a2edff000-2b0a2effe000 ---p 2044 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB /tmp/OCLuz6n0a.so
2b0a2effe000-2b0a2efff000 rw-p 4 KB 4 KB 4 KB 0 KB 0 KB 0 KB 4 KB 4 KB 4 KB 0 KB 0 KB /tmp/OCLuz6n0a.so
2b0a30000000-2b0a366b3000 rw-p 105164 KB 105164 KB 105164 KB 0 KB 0 KB 0 KB 105164 KB 105164 KB 105164 KB 0 KB 0 KB
2b0a366b3000-2b0a38000000 ---p 25908 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB
7fffca68b000-7fffca6ad000 rw-p 140 KB 96 KB 96 KB 0 KB 0 KB 0 KB 96 KB 96 KB 96 KB 0 KB 0 KB [stack]
7fffca733000-7fffca734000 r-xp 4 KB 4 KB 0 KB 4 KB 0 KB 0 KB 0 KB 4 KB 0 KB 0 KB 0 KB [vdso]
ffffffffff600000-ffffffffff601000 r-xp 4 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB 0 KB [vsyscall]
valgrind ./test
==14001== Memcheck, a memory error detector
==14001== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==14001== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==14001== Command: ./test
==14001==
Initial vector values:
a[i=0] = 0.000000 b[i=0] = 0.000000 c[i=0] = 0.000000
a[i=1] = 1.000000 b[i=1] = 10.000000 c[i=1] = 11.000000
a[i=2] = 2.000000 b[i=2] = 20.000000 c[i=2] = 22.000000
a[i=3] = 3.000000 b[i=3] = 30.000000 c[i=3] = 33.000000
a[i=4] = 4.000000 b[i=4] = 40.000000 c[i=4] = 44.000000
a[i=5] = 5.000000 b[i=5] = 50.000000 c[i=5] = 55.000000
a[i=6] = 6.000000 b[i=6] = 60.000000 c[i=6] = 66.000000
a[i=7] = 7.000000 b[i=7] = 70.000000 c[i=7] = 77.000000
a[i=8] = 8.000000 b[i=8] = 80.000000 c[i=8] = 88.000000
a[i=9] = 9.000000 b[i=9] = 90.000000 c[i=9] = 99.000000
Initializing OpenCL...
WARNING: Can't find a GPU. Trying a CPU...
Clear b on host:
a[i=0] = 0.000000 b[i=0] = 0.000000 c[i=0] = 0.000000
a[i=1] = 1.000000 b[i=1] = 0.000000 c[i=1] = 11.000000
a[i=2] = 2.000000 b[i=2] = 0.000000 c[i=2] = 22.000000
a[i=3] = 3.000000 b[i=3] = 0.000000 c[i=3] = 33.000000
a[i=4] = 4.000000 b[i=4] = 0.000000 c[i=4] = 44.000000
a[i=5] = 5.000000 b[i=5] = 0.000000 c[i=5] = 55.000000
a[i=6] = 6.000000 b[i=6] = 0.000000 c[i=6] = 66.000000
a[i=7] = 7.000000 b[i=7] = 0.000000 c[i=7] = 77.000000
a[i=8] = 8.000000 b[i=8] = 0.000000 c[i=8] = 88.000000
a[i=9] = 9.000000 b[i=9] = 0.000000 c[i=9] = 99.000000
Execute OpenCL kernel...
==14001== Thread 3:
==14001== Use of uninitialised value of size 8
==14001== at 0x64B0FBF: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001==
==14001== Use of uninitialised value of size 8
==14001== at 0xCC50355: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:8)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
==14001== Conditional jump or move depends on uninitialised value(s)
==14001== at 0x5818B8C: vfprintf (in /lib/libc-2.13.so)
==14001== by 0x581F4A8: printf (in /lib/libc-2.13.so)
==14001== by 0xCC50357: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:8)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
==14001== Use of uninitialised value of size 8
==14001== at 0x5814EB6: ??? (in /lib/libc-2.13.so)
==14001== by 0x5817307: vfprintf (in /lib/libc-2.13.so)
==14001== by 0x581F4A8: printf (in /lib/libc-2.13.so)
==14001== by 0xCC50357: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:8)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
==14001== Conditional jump or move depends on uninitialised value(s)
==14001== at 0x5814EC1: ??? (in /lib/libc-2.13.so)
==14001== by 0x5817307: vfprintf (in /lib/libc-2.13.so)
==14001== by 0x581F4A8: printf (in /lib/libc-2.13.so)
==14001== by 0xCC50357: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:8)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
==14001== Use of uninitialised value of size 8
==14001== at 0xCC5036D: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:9)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
==14001== Use of uninitialised value of size 8
==14001== at 0xCC50373: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:9)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
==14001== Use of uninitialised value of size 8
==14001== at 0xCC50392: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:11)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
==14001== Use of uninitialised value of size 8
==14001== at 0xCC5039D: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:12)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
==14001== Use of uninitialised value of size 8
==14001== at 0xCC503BD: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:12)
==14001== by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001==
i = 0 a[i] = 0 b[i] = 0
i = 2 a[i] = 2 b[i] = 22
==14001== Invalid write of size 8
==14001== at 0x645E617: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f00 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E625: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f48 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E62F: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f50 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 4
==14001== at 0x645E633: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f58 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E645: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f80 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E652: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09fa0 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E65F: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09fc0 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E677: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f60 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E67C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09fe0 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E6A3: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f88 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E6AA: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09fa8 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E6B2: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09fc8 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E6BA: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f68 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645E6C2: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EA5E: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09fe8 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645EA6B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f00 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x645EC82: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09f48 is not stack'd, malloc'd or (recently) free'd
==14001==
==14001== Invalid write of size 8
==14001== at 0x64B0FB8: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645EC8A: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
==14001== by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
==14001== by 0x58A2AEC: clone (in /lib/libc-2.13.so)
==14001== Address 0x9c09eb8 is not stack'd, malloc'd or (recently) free'd
==14001==
i = 6 a[i] = 6 b[i] = 66
i = 4 a[i] = 4 b[i] = 44
i = 8 a[i] = 8 b[i] = 88
i = 1 a[i] = 1 b[i] = 11
i = 5 a[i] = 5 b[i] = 55
i = 9 a[i] = 9 b[i] = 99
i = 3 a[i] = 3 b[i] = 33
i = 7 a[i] = 7 b[i] = 77
Read back to host memory...
New vector values:
a[i=0] = 0.000000 b[i=0] = 0.000000 c[i=0] = 0.000000
a[i=1] = 1.000000 b[i=1] = 11.000000 c[i=1] = 11.000000
a[i=2] = 2.000000 b[i=2] = 22.000000 c[i=2] = 22.000000
a[i=3] = 3.000000 b[i=3] = 33.000000 c[i=3] = 33.000000
a[i=4] = 4.000000 b[i=4] = 44.000000 c[i=4] = 44.000000
a[i=5] = 5.000000 b[i=5] = 55.000000 c[i=5] = 55.000000
a[i=6] = 6.000000 b[i=6] = 66.000000 c[i=6] = 66.000000
a[i=7] = 7.000000 b[i=7] = 77.000000 c[i=7] = 77.000000
a[i=8] = 8.000000 b[i=8] = 88.000000 c[i=8] = 88.000000
a[i=9] = 9.000000 b[i=9] = 99.000000 c[i=9] = 99.000000
Success! c == b
==14001==
==14001== HEAP SUMMARY:
==14001== in use at exit: 200,048 bytes in 414 blocks
==14001== total heap usage: 104,632 allocs, 104,218 frees, 22,231,163 bytes allocated
==14001==
==14001== LEAK SUMMARY:
==14001== definitely lost: 12,871 bytes in 23 blocks
==14001== indirectly lost: 3,318 bytes in 17 blocks
==14001== possibly lost: 15,903 bytes in 48 blocks
==14001== still reachable: 167,956 bytes in 326 blocks
==14001== suppressed: 0 bytes in 0 blocks
==14001== Rerun with --leak-check=full to see details of leaked memory
==14001==
==14001== For counts of detected and suppressed errors, rerun with: -v
==14001== Use --track-origins=yes to see where uninitialised values come from
==14001== ERROR SUMMARY: 262 errors from 27 contexts (suppressed: 49 from 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.