source: CIVL/examples/cuda/send_function_test.cvl@ 22f2e8e

1.23 2.0 main test-branch
Last change on this file since 22f2e8e was a52ef0f, checked in by Zane Greenholt <zgrnhlt@…>, 4 years ago

Added tests for deadlockBug and sending functions in communicators

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5605 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 679 bytes
Line 
1#include <stdio.h>
2#include <comm.cvh>
3
4void testStream($gcomm gc){
5 $comm comm = $comm_create($here, gc, 1);
6 $message message = $comm_dequeue(comm, 0, $COMM_ANY_TAG);
7 printf("New kernel message received\n");
8 void (*kernel)();
9 $message_unpack(message, (void*)&kernel, sizeof(kernel));
10 kernel();
11 $comm_destroy(comm);
12}
13
14void print(){
15 printf("Inside kernel function");
16}
17
18void main(){
19 $gcomm gcomm = $gcomm_create($here, 2);
20 $comm comm = $comm_create($here, gcomm, 0);
21 $spawn testStream(gcomm);
22 $message message = $message_pack(0, 1, 0, (void*)&print, sizeof(&print));
23 $comm_enqueue(comm, message);
24 $comm_destroy(comm);
25 $gcomm_destroy(gcomm, NULL);
26}
Note: See TracBrowser for help on using the repository browser.