我有一个相当复杂的mql5 for-loop代码集,我需要通过opencl运行。这意味着我需要能够拥有一些调用他人的内核函数。因此,我试验了这个简单的代码,并且当我通过它调用另一个函数时,它无法创建程序(错误5105)。为什么?嵌套内核函数opencl
const string _cl_source=
" \r\n"
" \r\n"
"__kernel void Tester() \r\n"
"{ \r\n"
" \r\n"
" float _margin = 10f; \r\n"
" float _balance = 10f; \r\n"
" float _equity = 10f; \r\n"
" float _openprice = 10f; \r\n"
" float _closeprice = 10f; \r\n"
" float _position = 10f; \r\n"
" \r\n"
/*fails on adding this line*/" CouponReset(_margin,_balance,_equity,_openprice,_closeprice,_position);\r\n"
" \r\n"
"} \r\n"
" \r\n"
" \r\n"
"__kernel void CouponReset(float margin, \r\n"
" float balance, \r\n"
" float equity, \r\n"
" float openprice, \r\n"
" float closeprice, \r\n"
" float position) \r\n"
"{ \r\n"
" position = 0f; \r\n"
" openprice = 0f; \r\n"
" closeprice = 0f; \r\n"
" balance = equity; \r\n"
" margin = balance; \r\n"
" \r\n"
"} \r\n"
" \r\n";
你可以把0.0f放在所有零的末尾吗? –
好的,让我试试。 thx – ssn
做到了这一点,仍然有相同的错误! – ssn