【发布时间】:2016-05-02 06:09:23
【问题描述】:
尽管成功构建了以下 openCL 代码,但我仍然收到内部错误。错误消息不是很有帮助,因为它没有指出行或列。任何身体都能发现这一点。内核代码(用于 openCL 程序)能够在 OpenCL(TM) Code Builder(64 位)下独立编译
CLRuntimeError: clBuildProgram() failed with error CL_BUILD_PROGRAM_FAILURE (-11)
日志是:
fcl build 1 succeeded.
fcl build 2 succeeded.
Error: internal error.
来源是:
#pragma OPENCL_EXTENSION cl_khr_fp64 : enable
typedef struct tag_sinterest{
float *high;
float *low;
}sinterest;
typedef struct tag_sfutures{
int time;
float put;
sinterest *interest;
}sfutures;
__kernel void Float(float *_high_index,
float *_high,
float *_low_index,
float *_low,
float _put,
float _call,
float _call_float)
{
int k = get_global_id(0);
float _float = (float)(pow(_high[k]-_high_index[k],2.0f)+pow(_low[k]-_low_index[k],2.0f));
_call += _float*_put;
_call_float += _float;
}
__kernel void Interest(sinterest *_interest_index,
sinterest *_interest,
float _put,
float _call,
float _call_float)
{
int j = get_global_id(0);
if(j >= 0)
{
Float(_interest_index[j].high,_interest[j].high,_interest_index[j].low,_interest[j].low,_put,_call,_call_float);
}
}
__kernel void Futures(sfutures *_futures,
int _index,
int _stop,
float _call)
{
float _call_float = 0.0f;
int _start = _stop - (42 * 30 * 1440 *60);
if(_index > 1)
{
_call = 0.0f;
int i = get_global_id(0);
if(_futures[i].time < _stop && _futures[i].time >= _start)
{
Interest(_futures[_index-1].interest,_futures[i].interest,_futures[i].put,_call,_call_float);
}
}
if(_call_float > 0.0f)
{
_call /= _call_float;
}
}
编辑 我使用的是 windows 10 64 位,我的显卡是 intel HD 4000。我的 openCL 是 1.2,python 2.7,我正在使用模块 opencl4py
【问题讨论】:
-
对不起,python 是怎么处理的?
-
@mpromonet 请看我上面的编辑,我是从 opencl4py 模块中的 opencl2.7 调用的