<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/158021>158021</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-repl] : Splitting input about lines produces different results with cuda flag
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
anutosh491
</td>
</tr>
</table>
<pre>
As pointed out by @Vipul-Cariappa , it seems splitting input about lines (or clubbing them into 1) might produce different results.
Here's my attempt on https://github.com/llvm/llvm-project/blob/main/clang/test/Interpreter/CUDA/sanity.cu
```
anutosh491@vv-nuc:/build/anutosh491/llvm-project/build2/bin$ ./clang-repl --cuda
clang-repl> extern "C" int printf(const char*, ...);__global__ void test_func() {}test_func<<<1,1>>>();printf("CUDA Error: %d\n", cudaGetLastError());
CUDA Error: 98
clang-repl> %quit
anutosh491@vv-nuc:/build/anutosh491/llvm-project/build2/bin$ ./clang-repl --cuda
clang-repl> extern "C" int printf(const char*, ...);
clang-repl> __global__ void test_func() {}
clang-repl> test_func<<<1,1>>>();
clang-repl> printf("CUDA Error: %d\n", cudaGetLastError());
CUDA Error: 0
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUVE-PqzYQ_zTDZRRkhhDCgQObLG2l3qrXa2TAgCvHpvY4r_vtKyf7ultFql4PPVQaCWTPDL8_6CdD0ItVqoXqBapzJiOvzrfSRnZh3TdFNrjpre0Cbk5bVhO6yDi8IezFr3qLZneSXsttkwh0Qs0YlLoGDJvRzNouqO0WGeWQ5oy2KiDQ0XkcTRyG1MCruqK27LAAavCql5Vx826Ko8JJz7PyyjJ6FaLhkIPoQHQ_Kq-A6oDXN5TM6roxOosr8xag7IB6oH7RvMYhH90VqDfm9u2x27z7TY0M1A_GDUD9VWoL1I9G2gWoZxXS5U-Wld-8YuWB-tOXc9obpNX8lo_xAQQO4r1E96Ea7MXttrNxfGAZojYTUP-p4RlJ6qH0kqDsMf-GZ-fVZnC3G-MkQXQfZ1C-ovqDlbcIRCcgSjLi5rXlGeg4OhsYx1V6oC65k-c5UAPly-WyGDdIc7ngzekJE9_LHO0IdEweQP0C9fnjtDw9qgA6FVC-vte9GcqXv76YYHw5d_jqvfNQdghUTVCdLBAlAInCD4p_loEfLY8N9yUgur_PNscntkDV71HzQ_n_jdpPa75P_qex7_bjafK_MUh8_v2zqS2npmxkptqirurqWO7pkK3tcZ4ndahGcSgONNXyMNZHOdaqGeZpP8oq0y0JqkRTFKIpa3HIZXOgQ1ENaq6Gsm5K2At1ldrkycPc-SXTIUTVFtVRUJEZOSgT7gFGZNVXvN8mQtU58-3d-CEuAfbC6MDhYw1rNvfk-6RWdcbE7Zd_yK_3bArP4YRfNa93EXE2csmiN-2_jqQ7_ADUv_O7tfRnAAAA__9GLMJs">