From face991588c643b74ba0ffd02e3cfacc84612125 Mon Sep 17 00:00:00 2001
From: noraabiakar <nora.abiakar@gmail.com>
Date: Wed, 3 Oct 2018 14:21:34 +0200
Subject: [PATCH] pass correct index to the NMODL procedures (#610)

Fixes an error in vectorized kernels that sees the incorrect index passed to PROCEDURE calls.
The loop index variable was being passed, instead of the pack of vector indexes.

Fixes #609
---
 modcc/printer/cprinter.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modcc/printer/cprinter.cpp b/modcc/printer/cprinter.cpp
index 99cc3dc9..19eda4d0 100644
--- a/modcc/printer/cprinter.cpp
+++ b/modcc/printer/cprinter.cpp
@@ -544,7 +544,7 @@ void SimdPrinter::visit(IndexedVariable *sym) {
 }
 
 void SimdPrinter::visit(CallExpression* e) {
-    out_ << e->name() << "(i_";
+    out_ << e->name() << "(index_";
     for (auto& arg: e->args()) {
         out_ << ", ";
         arg->accept(this);
@@ -578,7 +578,7 @@ void SimdPrinter::visit(BlockExpression* block) {
 }
 
 void emit_simd_procedure_proto(std::ostream& out, ProcedureExpression* e, const std::string& qualified) {
-    out << "void " << qualified << (qualified.empty()? "": "::") << e->name() << "(int i_";
+    out << "void " << qualified << (qualified.empty()? "": "::") << e->name() << "(index_type i_";
     for (auto& arg: e->args()) {
         out << ", const simd_value& " << arg->is_argument()->name();
     }
-- 
GitLab