Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm/execution: Use 'evaluate' function params when constructing simulation input #2467

Merged
merged 1 commit into from
Aug 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions psyneulink/core/llvm/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,11 @@ def cuda_execute(self, inputs):

# Methods used to accelerate "Run"

def _get_run_input_struct(self, inputs, num_input_sets):
input_type = self._bin_run_func.byref_arg_types[3]
def _get_run_input_struct(self, inputs, num_input_sets, arg=3):
# Callers that override input arg, should ensure that _bin_func is not None
bin_f = self._bin_run_func if arg == 3 else self._bin_func

input_type = bin_f.byref_arg_types[arg]
c_input = (input_type * num_input_sets) * len(self._execution_contexts)
if len(self._execution_contexts) == 1:
inputs = [inputs]
Expand Down Expand Up @@ -694,8 +697,8 @@ def _prepare_evaluate(self, inputs, num_input_sets, num_evaluations):
ct_comp_state = self._get_compilation_param('_eval_state', '_get_state_initializer', 1)
ct_comp_data = self._get_compilation_param('_eval_data', '_get_data_initializer', 6)

# Construct input variable
ct_inputs = self._get_run_input_struct(inputs, num_input_sets)
# Construct input variable, the 5th parameter of the evaluate function
ct_inputs = self._get_run_input_struct(inputs, num_input_sets, 5)

# Output ctype
out_ty = bin_func.byref_arg_types[4] * num_evaluations
Expand Down