Skip to content

Commit

Permalink
Merge pull request #181 from gongzg/master
Browse files Browse the repository at this point in the history
OpenCL: Avoid incorrect flag when create ocl memory object.
  • Loading branch information
karlrupp committed Mar 3, 2016
2 parents b0ee36d + 04f1063 commit cdcf992
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion viennacl/ocl/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class context
#if defined(VIENNACL_DEBUG_ALL) || defined(VIENNACL_DEBUG_CONTEXT)
std::cout << "ViennaCL: Creating memory of size " << size << " for context " << h_ << " (unsafe, returning cl_mem directly)" << std::endl;
#endif
if (ptr)
if (ptr && !(flags & CL_MEM_USE_HOST_PTR))
flags |= CL_MEM_COPY_HOST_PTR;
cl_int err;
cl_mem mem = clCreateBuffer(h_.get(), flags, size, ptr, &err);
Expand Down

0 comments on commit cdcf992

Please sign in to comment.