Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Added built-in ParModelica functions.
+ fix parallelism propagation. + temporary fix on simulation settings for ParModelica case. + initialize OpenCL env only when needed. + sum fixes. git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12639 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
Showing
10 changed files
with
204 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
SimulationRuntime/ParModelica/OpenCLRuntime/ParModelicaBuiltin.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
|
||
|
||
// package ParModelica | ||
|
||
function oclGetWorkDim | ||
output Integer dim; | ||
external "builtin"; | ||
end oclGetWorkDim; | ||
|
||
function oclGetGlobalSize | ||
input Integer dim; | ||
output Integer size; | ||
external "builtin"; | ||
end oclGetGlobalSize; | ||
|
||
function oclGetGlobalId | ||
input Integer dim; | ||
output Integer id; | ||
external "builtin"; | ||
end oclGetGlobalId; | ||
|
||
function oclGetLocalSize | ||
input Integer dim; | ||
output Integer size; | ||
external "builtin"; | ||
end oclGetLocalSize; | ||
|
||
function oclGetLocalId | ||
input Integer dim; | ||
output Integer id; | ||
external "builtin"; | ||
end oclGetLocalId; | ||
|
||
function oclGetNumGroups | ||
input Integer dim; | ||
output Integer num; | ||
external "builtin"; | ||
end oclGetNumGroups; | ||
|
||
function oclGetGroupId | ||
input Integer dim; | ||
output Integer id; | ||
external "builtin"; | ||
end oclGetGroupId; | ||
|
||
function oclGlobalBarrier | ||
external "builtin"; | ||
end oclGlobalBarrier; | ||
|
||
function oclSetNumThreadsOnlyGlobal | ||
input Integer num_threads; | ||
external "builtin"; | ||
end oclSetNumThreadsOnlyGlobal; | ||
|
||
function oclSetNumThreadsGlobalLocal | ||
input Integer global_num_threads; | ||
input Integer local_num_threads; | ||
external "builtin"; | ||
end oclSetNumThreadsGlobalLocal; | ||
|
||
function oclSetNumThreadsGlobalLocal1D | ||
input Integer[1] global_num_threads; | ||
input Integer[1] local_num_threads; | ||
external "builtin"; | ||
end oclSetNumThreadsGlobalLocal1D; | ||
|
||
function oclSetNumThreadsGlobalLocal2D | ||
input Integer[2] global_num_threads; | ||
input Integer[2] local_num_threads; | ||
external "builtin"; | ||
end oclSetNumThreadsGlobalLocal2D; | ||
|
||
function oclSetNumThreadsGlobalLocal3D | ||
input Integer[3] global_num_threads; | ||
input Integer[3] local_num_threads; | ||
external "builtin"; | ||
end oclSetNumThreadsGlobalLocal3D; | ||
|
||
function oclSetNumThreadsGlobalLocalError | ||
input Integer[:] global_num_threads; | ||
input Integer[:] local_num_threads; | ||
external "builtin"; | ||
end oclSetNumThreadsGlobalLocalError; | ||
|
||
function oclSetNumThreads = overload( | ||
oclSetNumThreadsOnlyGlobal, | ||
oclSetNumThreadsGlobalLocal1D, | ||
oclSetNumThreadsGlobalLocal2D, | ||
oclSetNumThreadsGlobalLocal3D | ||
); | ||
|
||
|
||
|
||
|
||
encapsulated package OpenCL | ||
|
||
function matrixMult | ||
parglobal input Integer A[:,:]; | ||
parglobal input Integer B[:,:]; | ||
parglobal output Integer C[:,:]; | ||
external "builtin"; | ||
end matrixMult; | ||
|
||
function matrixTranspose | ||
parglobal input Integer A[:,:]; | ||
parglobal output Integer B[:,:]; | ||
external "builtin"; | ||
end matrixTranspose; | ||
|
||
end OpenCL; | ||
|
||
// end ParModelica; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.