Skip to content

Commit

Permalink
Fixes flexflow#906. Capture variables in lambda by copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
suranap committed Aug 22, 2023
1 parent d13991c commit ec12b27
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/ops/attention.cc
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ bool MultiHeadAttention::measure_operator_cost(
cost_metrics.outputs_memory +=
cost_metrics.total_mem_diff_from(sim->offset);

backward = [&] {
backward = [=] {
backward_kernel_wrapper(m,
query_ptr,
query_grad_ptr,
Expand Down
2 changes: 1 addition & 1 deletion src/ops/batch_norm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ bool BatchNorm::measure_operator_cost(Simulator *sim,
cost_metrics.weights_memory +=
cost_metrics.total_mem_diff_from(sim->offset);

backward = [&] {
backward = [=] {
backward_kernel(m,
input_ptr,
output_grad_ptr,
Expand Down
2 changes: 1 addition & 1 deletion src/ops/concat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ bool Concat::measure_operator_cost(Simulator *sim,
cost_metrics.backward_time = Simulator::MAXIMUM_TASK_RUN_TIME;
return true;
}
backward = [&] {
backward = [=] {
backward_kernel_wrapper(
m, output_grad_acc, input_grad_accs, numInputs, legion_axis);
};
Expand Down
2 changes: 1 addition & 1 deletion src/ops/dropout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ bool Dropout::measure_operator_cost(Simulator *sim,
cost_metrics.outputs_memory +=
cost_metrics.total_mem_diff_from(sim->offset);

backward = [&] {
backward = [=] {
backward_kernel_wrapper(m, output_grad_ptr, input_grad_ptr);
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/ops/element_binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ bool ElementBinary::measure_operator_cost(Simulator *sim,
cost_metrics.outputs_memory +=
cost_metrics.total_mem_diff_from(sim->offset);

backward = [&] {
backward = [=] {
backward_kernel_wrapper(m,
output_grad_ptr,
input1_ptr,
Expand Down
2 changes: 1 addition & 1 deletion src/ops/element_unary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ bool ElementUnary::measure_operator_cost(Simulator *sim,
cost_metrics.outputs_memory +=
cost_metrics.total_mem_diff_from(sim->offset);

backward = [&] {
backward = [=] {
backward_kernel_wrapper(m,
input_ptr,
input_grad_ptr,
Expand Down
2 changes: 1 addition & 1 deletion src/ops/flat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ bool Flat::measure_operator_cost(Simulator *sim,

assert(output_grad_ptr != NULL);
assert(input_grad_ptr != NULL);
backward = [&] {
backward = [=] {
backward_kernel_wrapper(input_grad_ptr, output_grad_ptr, num_elements);
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/ops/layer_norm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ bool LayerNorm::measure_operator_cost(Simulator *sim,
return true;
}

backward = [&] {
backward = [=] {
backward_kernel_wrapper<float>(m,
out_grad_ptr,
in_ptr,
Expand Down
2 changes: 1 addition & 1 deletion src/ops/linear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ bool Linear::measure_operator_cost(Simulator *sim,
cost_metrics.backward_time = Simulator::MAXIMUM_TASK_RUN_TIME;
return true;
}
backward = [&] {
backward = [=] {
backward_kernel_wrapper(m,
input_ptr,
input_grad_ptr,
Expand Down
2 changes: 1 addition & 1 deletion src/ops/reduce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ bool Reduce::measure_operator_cost(Simulator *sim,
GenericTensorAccessorR output_grad_acc(
outputs[0]->data_type, sub_output.get_domain(), output_grad_ptr);

backward = [&] {
backward = [=] {
backward_kernel_wrapper(m, output_grad_acc, input_grad_acc);
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/ops/reverse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ bool Reverse::measure_operator_cost(Simulator *sim,
cost_metrics.outputs_memory +=
cost_metrics.total_mem_diff_from(sim->offset);

backward = [&] {
backward = [=] {
backward_kernel_wrapper(output_grad_ptr,
input_grad_ptr,
num_out_blks,
Expand Down

0 comments on commit ec12b27

Please sign in to comment.