diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 9f1eb6f6d..5909ca6e4 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -1459,6 +1459,10 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, return StmtDiff(Clone(CE)); } + // FIXME: Revisit this when variadic functions are supported. + if (FD->getNameAsString() == "printf" || FD->getNameAsString() == "fprintf") + return StmtDiff(Clone(CE)); + Expr* CUDAExecConfig = nullptr; if (const auto* KCE = dyn_cast(CE)) CUDAExecConfig = Clone(KCE->getConfig()); diff --git a/test/CUDA/GradientKernels.cu b/test/CUDA/GradientKernels.cu index 328a1f50d..969a1b1c1 100644 --- a/test/CUDA/GradientKernels.cu +++ b/test/CUDA/GradientKernels.cu @@ -436,6 +436,7 @@ double fn_memory(double *out, double *in) { cudaMemcpy(out_host, out, 10 * sizeof(double), cudaMemcpyDeviceToHost); double res = 0; for (int i=0; i < 10; ++i) { + printf("Writing result of out[%d]\n", i); res += out_host[i]; } free(out_host); @@ -469,6 +470,7 @@ double fn_memory(double *out, double *in) { //CHECK-NEXT: break; //CHECK-NEXT: } //CHECK-NEXT: _t0++; +//CHECK-NEXT: printf("Writing result of out[%d]\n", i); //CHECK-NEXT: clad::push(_t1, res); //CHECK-NEXT: res += out_host[i]; //CHECK-NEXT: }