Skip to content

Commit adaf209

Browse files
committed
Write out code_omp line by line
1 parent 3a91884 commit adaf209

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/test_xcpp_kernel.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,19 @@ class XCppTests(jupyter_kernel_test.KernelTests):
131131
'mime': 'image/png'
132132
}
133133
]
134-
code_omp='#include <omp.h>\n#include <iostream>\n#include <clang/Interpreter/CppInterOp.h>\n\nCpp::LoadLibrary("libomp");int max_threads = omp_get_max_threads();omp_set_thread_num(max_threads);#pragma omp parallel \\\n { \n if(omp_get_thread_num()==2) {\n std::cerr<<omp_get_thread_num()<<std::endl;}\n}\n'
134+
code_omp="""
135+
#include <omp.h>
136+
#include <iostream>
137+
#include <clang/Interpreter/CppInterOp.h>
138+
Cpp::LoadLibrary("libomp");
139+
int max_threads = omp_get_max_threads();
140+
omp_set_thread_num(max_threads);
141+
#pragma omp parallel
142+
{
143+
if(omp_get_thread_num()==2) {
144+
std::cerr<<omp_get_thread_num()<<std::endl;
145+
}
146+
}"""
135147
def test_xcpp_omp(self):
136148
self.flush_channels()
137149
reply, output_msgs = self.execute_helper(code=self.code_omp,timeout=1)

0 commit comments

Comments
 (0)