#3326 closed defect (fixed)
ParModelica: Error setting kernel arguments: CL_INVALID_ARG_SIZE
Reported by: | Gustaf Thorslund | Owned by: | Mahder Alemseged Gebremedhin |
---|---|---|---|
Priority: | blocker | Milestone: | 1.9.4 |
Component: | ParModelica | Version: | trunk |
Keywords: | Cc: |
Description
After applying my workaround in #3324 I try to call a small function. The test is almost same as in #3242, but here I've added a phony input argument too (see below). Now tries to run a kernel for me, but fails.
2 CL_DEVICE_NAME : Intel(R) HD Graphics Haswell M 2 CL_DRIVER_VERSION : 0.8.0 2 CL_DEVICE_MAX_COMPUTE_UNITS : 64 2 CL_DEVICE_MAX_CLOCK_FREQUENCY : 1000 2 CL_DEVICE_LOCAL_MEM_SIZE : 64 KB 2 CL_DEVICE_GLOBAL_MEM_SIZE: 128 MB 2 CL_DEVICE_MAX_MEM_ALLOC_SIZE: 128 MB 2 CL_DEVICE_MAX_PARAMETER_SIZE: 1024 MB 2 CL_DEVICE_MAX_WORK_GROUP_SIZE: 512 2 CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE : 0 - Select your device: 2 OpenCL initialization : 1349.381000 ms Error setting kernel arguments: CL_INVALID_ARG_SIZE Error: setting argument nr: 1
Here comes the code:
package oclTest constant Integer globalSizes = 10; constant Integer localSizes = 2; parkernel function Kernel input Integer S; parglobal input Integer i[10]; parglobal output Integer groupId[globalSizes]; parglobal output Integer localId[globalSizes]; protected Integer g; algorithm g := oclGetGlobalId(1); groupId[g] := oclGetGroupId(1); localId[g] := oclGetLocalId(1); end Kernel; function test output Integer groupId[globalSizes]; output Integer localId[globalSizes]; protected parglobal Integer p_groupId[globalSizes]; parglobal Integer p_localId[globalSizes]; Integer I[10]; parglobal Integer pI[10]; algorithm for i loop I[i] := i; end for; pI := I; oclSetNumThreadsGlobalLocal1D({globalSizes}, {localSizes}); (p_groupId, p_localId) := Kernel(7,pI); groupId := p_groupId; localId := p_localId; end test; end oclTest;
Together with the script used to call it:
// name: oclTest // cflags: +g=ParModelica // status: correct // setGrammarParModelica(); setCommandLineOptions("+d=noevalfunc +g=ParModelica -v=1"); loadFile("oclTest.mo"); getErrorString(); (x,y):=oclTest.test(); getErrorString();
Trying a parfor gives same kernel failure. For example:
package ParForTest constant Integer globalSizes = 10; constant Integer localSizes = 2; constant Integer elements = 10; function test input Integer a; output Integer result[elements]; protected Integer v[elements] = {i for i in 1:elements}; parglobal Integer pv[elements]; parglobal Integer pr[elements]; parglobal Integer pa; algorithm oclSetNumThreadsGlobalLocal1D({globalSizes}, {localSizes}); pa := a; pv := v; parfor i in 1 : elements loop pr[i] := pa * pv[i]; end parfor; result := pr; end test; end ParForTest;
Called with the script:
setCommandLineOptions("+d=noevalfunc +g=ParModelica -v=1"); getErrorString(); loadFile("parfor.mo"); getErrorString(); x:=ParForTest.test(5); getErrorString();
Change History (6)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Update of test script shows the test actually works on some CPU drivers for OpenCL.
-
test/parmodelica/oclTest.mos
a b getErrorString(); 9 9 10 10 (x,y):=oclTest.test(); 11 11 getErrorString(); 12 x; 13 y;
Error copying device to device: CL_MEM_COPY_OVERLAP "" {1,1,2,2,3,3,4,4,5,5} {1,2,1,2,1,2,1,2,1,2}
comment:3 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 9 years ago
Milestone: | Future → 1.9.4 |
---|
Sorting these closed tickets away from "Future". Since they were closed after the last 1.9.3 release, it's very likely that they should have been part of the 1.9.4 release.
I've now tried this on our test machine fermi. Using the oclTest.mos above, I get the following three errors for the available three devices:
The parfor.mos test, does however work for the two Intel devices:
It gives same CL_INVALID_ARG_SIZE error for the Tesla device.