From 0473bffa30b79b1467242a4470a049bdeab73e6a Mon Sep 17 00:00:00 2001 From: allem Date: Tue, 10 Dec 2019 22:11:22 -0500 Subject: [PATCH] prefetch starting at hint --- gpu-opt/main.cu | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gpu-opt/main.cu b/gpu-opt/main.cu index 67ba026..b3dcf25 100644 --- a/gpu-opt/main.cu +++ b/gpu-opt/main.cu @@ -131,13 +131,14 @@ bool add_coset( int *coset, int *hint, thrust::device_vector &dcosets) { - thrust::host_vector cosets = dcosets; - *coset = cosets.size() / ngens; + int offset = *hint; + thrust::host_vector cosets(dcosets.begin() + offset, dcosets.end()); + *coset = dcosets.size() / ngens; // todo: this part especially. - while (cosets[*hint] >= 0) { + while (cosets[*hint - offset] >= 0) { *hint = *hint + 1; - if (*hint >= cosets.size()) + if (*hint - offset >= cosets.size()) return true; } int from = *hint / ngens;