Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
opencl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mastersthesis-philipp
opencl
Commits
d365cd44
Commit
d365cd44
authored
Mar 01, 2017
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable executing NDRange kernels
parent
2e0bd273
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
README.md
README.md
+1
-1
commandqueue.go
commandqueue.go
+30
-0
No files found.
README.md
View file @
d365cd44
...
...
@@ -34,7 +34,7 @@ It is mainly developed and tested on Linux and with Intel and Nvidia GPUs. It sh
-
[
x
]
creating and releasing kernels
-
[
x
]
setting arguments
-
[
]
querying kernel, work group and argument info
-
[
]
executing kernels
-
[
x
]
executing kernels
-
[
]
event objects
-
[
]
creating and releasing user events (not planned for now)
-
[
]
query event info
...
...
commandqueue.go
View file @
d365cd44
...
...
@@ -86,3 +86,33 @@ func (q CommandQueue) EnqueueWriteBuffer(memory Memory, offset uintptr, buffer [
}
return
nil
}
func
(
q
CommandQueue
)
EnqueueNDRangeKernel
(
kernel
Kernel
,
globalWorkOffset
,
globalWorkSize
,
localWorkSize
[]
uintptr
,
waitList
[]
Event
)
(
*
Event
,
error
)
{
if
len
(
globalWorkOffset
)
!=
len
(
globalWorkSize
)
||
len
(
globalWorkOffset
)
!=
len
(
localWorkSize
)
{
return
nil
,
fmt
.
Errorf
(
"globalWorkOffset, globalWorkSize and localWorkSize have to have the same length"
)
}
// TODO: check that len(dim) > 0
dim
:=
C
.
cl_uint
(
len
(
globalWorkOffset
))
clGlobalWorkOffset
:=
make
([]
C
.
size_t
,
dim
)
clGlobalWorkSize
:=
make
([]
C
.
size_t
,
dim
)
clLocalWorkSize
:=
make
([]
C
.
size_t
,
dim
)
for
i
:=
range
globalWorkOffset
{
clGlobalWorkOffset
[
i
]
=
C
.
size_t
(
globalWorkOffset
[
i
])
clGlobalWorkSize
[
i
]
=
C
.
size_t
(
globalWorkSize
[
i
])
clLocalWorkSize
[
i
]
=
C
.
size_t
(
localWorkSize
[
i
])
}
var
clEventsPtr
*
C
.
cl_event
if
len
(
waitList
)
>
0
{
clEventsPtr
=
&
asCLEventList
(
waitList
)[
0
]
}
var
event
Event
err
:=
C
.
clEnqueueNDRangeKernel
(
q
.
queue
,
kernel
.
kernel
,
dim
,
&
clGlobalWorkOffset
[
0
],
&
clGlobalWorkSize
[
0
],
&
clLocalWorkSize
[
0
],
C
.
cl_uint
(
len
(
waitList
)),
clEventsPtr
,
&
event
.
event
)
if
err
!=
C
.
CL_SUCCESS
{
return
nil
,
fmt
.
Errorf
(
"failed to enqueue kernel: %d"
,
err
)
}
return
&
event
,
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment