diff --git a/graph_framework/cuda_context.hpp b/graph_framework/cuda_context.hpp index 4ed324a646a6bc98c8d1344733643e860c3d6e26..d03b9f4e269daa4aaa7547647146af672ffa61fa 100644 --- a/graph_framework/cuda_context.hpp +++ b/graph_framework/cuda_context.hpp @@ -756,23 +756,23 @@ namespace gpu { } } for (size_t i = 0, ie = outputs.size(); i < ie; i++) { - if (i == 0) { - if (inputs.size()) { - source_buffer << ", // " - << inputs[inputs.size() - 1]->get_symbol(); + if (!used_args.contains(outputs[i].get())) { + if (i == 0) { + if (inputs.size()) { + source_buffer << ", // " + << inputs[inputs.size() - 1]->get_symbol(); #ifndef USE_INPUT_CACHE #ifdef SHOW_USE_COUNT - source_buffer << " used " - << usage.at(inputs[inputs.size() - 1].get()); + source_buffer << " used " + << usage.at(inputs[inputs.size() - 1].get()); #endif #endif - source_buffer << std::endl; + source_buffer << std::endl; + } + } else { + source_buffer << "," << std::endl; } - } else { - source_buffer << "," << std::endl; - } - if (!used_args.contains(outputs[i].get())) { source_buffer << " "; jit::add_type (source_buffer); source_buffer << " * __restrict__ " diff --git a/graph_tests/jit_test.cpp b/graph_tests/jit_test.cpp index 1d12fa668bb8f744e4e8df51c463f9cf9785b108..7b811b929c694b570ba2a8a9c361cf0bb01ad686 100644 --- a/graph_tests/jit_test.cpp +++ b/graph_tests/jit_test.cpp @@ -332,7 +332,7 @@ template void run_math_tests() { auto sin_node = graph::sin(v1); compile ({graph::variable_cast(v1)}, {sin_node}, {}, - sin_node->evaluate().at(0), 0.0); + sin_node->evaluate().at(0), result); auto cos_node = graph::cos(v1); compile ({graph::variable_cast(v1)},