Skip to content

Commit 73d978b

Browse files
committed
workaround an issue with boost::algorithm::trim()
on some platforms trim() would cut off function argument names in the CL kernel declaration and therefore breaks custom closures; the functionality is replaced by split() to circumvent this issue
1 parent 0035290 commit 73d978b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

include/boost/compute/closure.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ struct closure_signature_argument_inserter
216216
BOOST_ASSERT(capture_string[0] == '(' &&
217217
capture_string[capture_string_length-1] == ')');
218218
std::string capture_string_(capture_string + 1, capture_string_length - 2);
219-
boost::split(m_capture_names, capture_string_ , boost::is_any_of(","));
219+
boost::split(m_capture_names, capture_string_ , boost::is_any_of(", "), boost::algorithm::token_compress_on);
220220
}
221221

222222
template<class T>
@@ -227,9 +227,6 @@ struct closure_signature_argument_inserter
227227
// get captured variable name
228228
std::string variable_name = m_capture_names[n];
229229

230-
// remove leading and trailing whitespace from variable name
231-
boost::trim(variable_name);
232-
233230
s << capture_traits<T>::type_name() << " " << variable_name;
234231
if(n+1 < m_last){
235232
s << ", ";

0 commit comments

Comments
 (0)