-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Is there a way to force Bohrium to copy an array to GPU?
I want to benchmark Bohrium against some other libraries, so I do something like this:
def prepare_inputs(np_inputs):
bh_inputs = [bh.array(k) for k in np_inputs]
bh.flush()
return bh_inputs
inputs = prepare_inputs(np_inputs)
with Timer():
run_benchmark(inputs)
bh.flush()But on GPU, the data is not copied during prepare_inputs, only when the data is accessed during run_benchmark. The timings I get for Bohrium are thus higher than for other libraries, which copy the data right away.
I found that the following works:
def prepare_inputs(np_inputs):
bh_inputs = [bh.array(k) for k in np_inputs]
for k in bh_inputs:
tmp = k * 1
bh.flush()
return bh_inputsBut it feels a bit stupid.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels