Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
92781661
Commit
92781661
authored
May 13, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'unstable' of github.com:Neverlord/libcppa into unstable
parents
6b5df06e
fd3cd11b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
25 deletions
+37
-25
libcaf_opencl/src/opencl/program.cpp
libcaf_opencl/src/opencl/program.cpp
+37
-25
No files found.
libcaf_opencl/src/opencl/program.cpp
View file @
92781661
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <vector>
#include <vector>
#include <cstring>
#include <cstring>
#include <iostream>
#include "cppa/opencl/program.hpp"
#include "cppa/opencl/program.hpp"
#include "cppa/opencl/command_dispatcher.hpp"
#include "cppa/opencl/command_dispatcher.hpp"
...
@@ -61,34 +62,41 @@ program program::create(const char* kernel_source) {
...
@@ -61,34 +62,41 @@ program program::create(const char* kernel_source) {
// build programm from program object
// build programm from program object
err
=
clBuildProgram
(
pptr
.
get
(),
0
,
nullptr
,
nullptr
,
nullptr
,
nullptr
);
err
=
clBuildProgram
(
pptr
.
get
(),
0
,
nullptr
,
nullptr
,
nullptr
,
nullptr
);
if
(
err
!=
CL_SUCCESS
)
{
if
(
err
!=
CL_SUCCESS
)
{
cl_int
bi_err
{
0
};
device_ptr
device_used
(
cppa
::
detail
::
singleton_manager
::
device_ptr
device_used
(
cppa
::
detail
::
singleton_manager
::
get_command_dispatcher
()
->
get_command_dispatcher
()
->
m_devices
.
front
().
dev_id
);
m_devices
.
front
().
dev_id
);
cl_build_status
build_status
;
cl_build_status
build_status
;
err
=
clGetProgramBuildInfo
(
pptr
.
get
(),
bi_
err
=
clGetProgramBuildInfo
(
pptr
.
get
(),
device_used
.
get
(),
device_used
.
get
(),
CL_PROGRAM_BUILD_STATUS
,
CL_PROGRAM_BUILD_STATUS
,
sizeof
(
cl_build_status
),
sizeof
(
cl_build_status
),
&
build_status
,
&
build_status
,
nullptr
);
nullptr
);
size_t
ret_val_size
;
size_t
ret_val_size
;
err
=
clGetProgramBuildInfo
(
pptr
.
get
(),
bi_err
=
clGetProgramBuildInfo
(
pptr
.
get
(),
device_used
.
get
(),
device_used
.
get
(),
CL_PROGRAM_BUILD_LOG
,
CL_PROGRAM_BUILD_LOG
,
0
,
0
,
nullptr
,
nullptr
,
&
ret_val_size
);
&
ret_val_size
);
std
::
vector
<
char
>
build_log
(
ret_val_size
+
1
);
std
::
vector
<
char
>
build_log
(
ret_val_size
);
err
=
clGetProgramBuildInfo
(
pptr
.
get
(),
bi_err
=
clGetProgramBuildInfo
(
pptr
.
get
(),
device_used
.
get
(),
device_used
.
get
(),
CL_PROGRAM_BUILD_LOG
,
CL_PROGRAM_BUILD_LOG
,
ret_val_size
,
ret_val_size
,
build_log
.
data
(),
build_log
.
data
(),
nullptr
);
nullptr
);
build_log
[
ret_val_size
]
=
'\0'
;
std
::
ostringstream
oss
;
std
::
ostringstream
oss
;
oss
<<
"clBuildProgram: "
<<
get_opencl_error
(
err
)
if
(
ret_val_size
<=
1
)
{
<<
", build log: "
<<
build_log
.
data
();
oss
<<
"clBuildProgram: "
<<
get_opencl_error
(
err
)
<<
" (no build log available)"
;
}
else
{
oss
<<
"clBuildProgram: "
<<
get_opencl_error
(
err
);
build_log
[
ret_val_size
-
1
]
=
'\0'
;
std
::
cerr
<<
build_log
.
data
()
<<
std
::
endl
;
}
CPPA_LOGM_ERROR
(
detail
::
demangle
<
program
>
().
c_str
(),
oss
.
str
());
CPPA_LOGM_ERROR
(
detail
::
demangle
<
program
>
().
c_str
(),
oss
.
str
());
throw
std
::
runtime_error
(
oss
.
str
());
throw
std
::
runtime_error
(
oss
.
str
());
}
}
...
@@ -118,9 +126,13 @@ program program::create(const char* kernel_source) {
...
@@ -118,9 +126,13 @@ program program::create(const char* kernel_source) {
ret_val_size
,
ret_val_size
,
build_log
.
data
(),
build_log
.
data
(),
nullptr
);
nullptr
);
build_log
[
ret_val_size
]
=
'\0'
;
if
(
ret_val_size
>
1
)
{
CPPA_LOGM_DEBUG
(
"program"
,
"clBuildProgram build log: "
CPPA_LOGM_ERROR
(
detail
::
demangle
<
program
>
().
c_str
(),
<<
build_log
.
data
());
"clBuildProgram: error"
);
build_log
[
ret_val_size
-
1
]
=
'\0'
;
std
::
cerr
<<
"clBuildProgram build log:
\n
"
<<
build_log
.
data
()
<<
std
::
endl
;
}
# endif
# endif
}
}
return
{
cptr
,
pptr
};
return
{
cptr
,
pptr
};
...
...
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