From 46475fa0361751e1076fa2ff3a723ef8db94f99e Mon Sep 17 00:00:00 2001 From: Sergey Kroshnin Date: Thu, 16 Jul 2020 10:40:48 +0300 Subject: [PATCH] Specify OpenCL clCreateBuffer() flags (#2842) --- nano/node/openclwork.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nano/node/openclwork.cpp b/nano/node/openclwork.cpp index b71e0ede..e887fa83 100644 --- a/nano/node/openclwork.cpp +++ b/nano/node/openclwork.cpp @@ -550,23 +550,23 @@ logger (logger_a) if (!error_a) { cl_int attempt_error (0); - attempt_buffer = clCreateBuffer (context, 0, sizeof (uint64_t), nullptr, &attempt_error); + attempt_buffer = clCreateBuffer (context, CL_MEM_READ_ONLY | CL_MEM_HOST_WRITE_ONLY, sizeof (uint64_t), nullptr, &attempt_error); error_a |= attempt_error != CL_SUCCESS; if (!error_a) { cl_int result_error (0); - result_buffer = clCreateBuffer (context, 0, sizeof (uint64_t), nullptr, &result_error); + result_buffer = clCreateBuffer (context, CL_MEM_WRITE_ONLY | CL_MEM_HOST_READ_ONLY, sizeof (uint64_t), nullptr, &result_error); error_a |= result_error != CL_SUCCESS; if (!error_a) { cl_int item_error (0); size_t item_size (sizeof (nano::uint256_union)); - item_buffer = clCreateBuffer (context, 0, item_size, nullptr, &item_error); + item_buffer = clCreateBuffer (context, CL_MEM_READ_ONLY | CL_MEM_HOST_WRITE_ONLY, item_size, nullptr, &item_error); error_a |= item_error != CL_SUCCESS; if (!error_a) { cl_int difficulty_error (0); - difficulty_buffer = clCreateBuffer (context, 0, sizeof (uint64_t), nullptr, &difficulty_error); + difficulty_buffer = clCreateBuffer (context, CL_MEM_READ_ONLY | CL_MEM_HOST_WRITE_ONLY, sizeof (uint64_t), nullptr, &difficulty_error); error_a |= difficulty_error != CL_SUCCESS; if (!error_a) {