opencl

How can a large number of assignments to the same array cause a pyopencl.LogicError when run on GPU?

我们两清 提交于 2019-12-02 10:38:03
问题 I'm using pyOpenCL to do some complex calculations. It runs fine on CPU, but I get an error when trying to run it on an NVIDIA GeForce 9400M (256 MB). I'm working on Mac OS X Lion (10.7.5) The strange thing is that this error does not always show up. It seems to occur when my calculations use larger numbers (resulting in larger iterations) but only when run on GPU. I'm not writing to memory locations I'm not supposed to write to. I ruled out possible problems with concurrent modification by

How to use hadoop MapReuce framework for an Opencl application?

白昼怎懂夜的黑 提交于 2019-12-02 10:28:46
I am developing an application in opencl whose basic objective is to implement a data mining algorithm on GPU platform. I want to use Hadoop Distributed File System and want to execute the application on multiple nodes. I am using MapReduce framework and I have divided my basic algorithm into two parts i.e. 'Map' and 'Reduce'. I have never worked in hadoop before so I have some questions: Do I have write my application in java only to use Hadoop and Mapeduce framework? I have written kernel functions for map and reduce in opencl. Is it possible to use HDFS a file system for a non java GPU

Calculate run time of kernel code in OpenCL C

时光总嘲笑我的痴心妄想 提交于 2019-12-02 10:03:22
I want to measure the performance (read runtime) of my kernel code on various devices viz CPU and GPUs. The kernel code that I wrote is: __kernel void dataParallel(__global int* A) { sleep(10); A[0]=2; A[1]=3; A[2]=5; int pnp;//pnp=probable next prime int pprime;//previous prime int i,j; for(i=3;i<500;i++) { j=0; pprime=A[i-1]; pnp=pprime+2; while((j<i) && A[j]<=sqrt((float)pnp)) { if(pnp%A[j]==0) { pnp+=2; j=0; } j++; } A[i]=pnp; } } However I have been told that it is not possible to use sleep() in the kernel code. If that is true then can someone give the reason and if it isn't please tell

Passing two options as arguments in OpenCL with Fortran (CLFORTRAN)

孤街浪徒 提交于 2019-12-02 09:51:10
问题 When my host program is in C language I can pass two options as an argument of an OpenCL function. For example, I can pass two flags to the clCreateBuffer function like this: clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(main_data), main_data, &err) However, when I try to do the same in a host program written in Fortran: main_data=clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, & sizeof(main_data), C_NULL_PTR, err) I get an error: & |CL_MEM_COPY_HOST

accessing file system using cpu device in opencl

烂漫一生 提交于 2019-12-02 09:07:44
问题 I am a newbie to opencl. I have a doubt about opencl functioning when kernel is running on a cpu device.Suppose we have a kernel running on a cpu device, can it read from a file on the disk. If yes,then how ? If no , then why not ? Can you please suggest a source for detailed information ?? thanks in advance. 回答1: You can't. OpenCL is trying to unite access to computing power and file system is depending on OS. If you want this feature, there are threads (C++11 thread, pthread,...) or OpenMP

How can a large number of assignments to the same array cause a pyopencl.LogicError when run on GPU?

。_饼干妹妹 提交于 2019-12-02 07:13:17
I'm using pyOpenCL to do some complex calculations. It runs fine on CPU, but I get an error when trying to run it on an NVIDIA GeForce 9400M (256 MB). I'm working on Mac OS X Lion (10.7.5) The strange thing is that this error does not always show up. It seems to occur when my calculations use larger numbers (resulting in larger iterations) but only when run on GPU. I'm not writing to memory locations I'm not supposed to write to. I ruled out possible problems with concurrent modification by running the code as a single work item. I simplified my OpenCL code as much as possible, and from what

SYCL exception caught: Error: [ComputeCpp:RT0101] Failed to create kernel ((Kernel Name: SYCL_class_multiply))

喜欢而已 提交于 2019-12-02 06:41:07
I cloned https://github.com/codeplaysoftware/computecpp-sdk.git and modified the computecpp-sdk/samples/accessors/accessors.cpp file. I just added std::cout << "SYCL exception caught: " << e.get_cl_code() << '\n'; . See the fully modified code : /*************************************************************************** * * Copyright (C) 2016 Codeplay Software Limited * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * *

accessing file system using cpu device in opencl

断了今生、忘了曾经 提交于 2019-12-02 05:13:01
I am a newbie to opencl. I have a doubt about opencl functioning when kernel is running on a cpu device.Suppose we have a kernel running on a cpu device, can it read from a file on the disk. If yes,then how ? If no , then why not ? Can you please suggest a source for detailed information ?? thanks in advance. You can't. OpenCL is trying to unite access to computing power and file system is depending on OS. If you want this feature, there are threads (C++11 thread, pthread,...) or OpenMP should be able to handle this, because it's CPU-only thing. It can't. Simply because not every OpenCL device

CL_DEVICE_NOT_AVAILABLE using Intel Core 2 Duo E8500 CPU

假装没事ソ 提交于 2019-12-02 04:50:57
问题 I get the error CL_DEVICE_NOT_AVAILABLE when running this sample code. However, unlike in that question, my CPU, the Intel Core 2 Duo E8500 CPU, appears to be supported. I've made sure to link against the Intel version of the OpenCL libraries, since I also have the Nvidia libraries installed. Why is this error occurring? 回答1: "CL_DEVICE_NOT_AVAILABLE" has nothing to do with the SDK. It's due to the OpenCL device driver which is part of the video card device driver. It's common to confuse the

OpenCL: using struct as kernel argument

梦想的初衷 提交于 2019-12-02 04:25:59
Can I use struct as OpenCL kernel argument? I want to use struct type as OpenCL kernel argument in NVIDIA OpenCL 1.2 (NVIDIA driver 352.39) I tried, but it makes CL_OUT_OF_RESOURCE error. What is wrong in my code?? [for struct definition] /* struct type definition */ typedef struct _st_foo { int aaa; int bbb; ..... int zzz; }st_foo; // st_foo doesn't have any pointer members [Host code] /* OpenCL initalize... */ st_foo stVar; cl_mem cm_buffer; cm_buffer = clCreateBuffer(cxContext, CL_MEM_READ_ONLY, sizeof(st_foo), NULL, NULL); clSetKernelArg(ckKernel, 0, sizeof(cl_mem), (void*)&cm_buffer);