Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
70 Views

dpct's result from multi-stream example gets `pure virtual method called`

Jump to solution

Hi, 

I try seeing how dpct handles cuda stream from a multi-stream example of https://developer.nvidia.com/blog/gpu-pro-tip-cuda-7-streams-simplify-concurrency/

dpct and dpcpp do not complain anything but running it I get the following message.

```
pure virtual method called
terminate called without an active exception
pure virtual method called
terminate called recursively
```

Even if I change

x[i] = sqrt(pow(3.14159,i)); // x[i] = sycl::sqrt(sycl::pown(3.14159, i));

to `x[i] = 0;`, it hangs for at least 10 mins.

 
Another thing from this example is different return type of `default_queue` and `create_queue`.
`default_queue()` returns object but `create_queue()` return a pointer.

dpct seems to convert cuda_stream_t to queue* correctly to fix the issue

Thanks,
Mike

0 Kudos

Accepted Solutions
Highlighted
Moderator
62 Views

Hi,

 

Could you please provide your OS details and oneAPI base-toolkit version that you have used?

 

I have migrated the cuda stream sample from the given link and I can compile/run the migrated code without any error. (tried on Ubuntu 18.04 with oneAPI beta08). Although I did not try to print anything to the output, the migrated dpct code as such is compilable.

 

Attaching the migrated file for reference.

 

 

Regards,

Rahul

View solution in original post

0 Kudos
5 Replies
Highlighted
Moderator
63 Views

Hi,

 

Could you please provide your OS details and oneAPI base-toolkit version that you have used?

 

I have migrated the cuda stream sample from the given link and I can compile/run the migrated code without any error. (tried on Ubuntu 18.04 with oneAPI beta08). Although I did not try to print anything to the output, the migrated dpct code as such is compilable.

 

Attaching the migrated file for reference.

 

 

Regards,

Rahul

View solution in original post

0 Kudos
Highlighted
Beginner
58 Views

Hi Ruhul,

I run it on devcloud. It also uses ubuntu 18.04 and dpct beta8.
The file you give is same as mine except for some comments.
After recompiling them, they all work.
I have no idea why it is failed or hangs for long time before.
Thanks a lot.

I attach my output and error from qsub in attachment although it may be helpless.

Thanks,
Mike

0 Kudos
Highlighted
Beginner
53 Views

Is any comments on it?

Another thing from this example is different return type of `default_queue` and `create_queue`.
`default_queue()` returns object but `create_queue()` return a pointer.

 

0 Kudos
Highlighted
Moderator
46 Views

Hi,

 

Hanging in between could be a Devcloud related issue in my opinion and not Dpc++/Dpct related.

 

default_queue(); will return a pointer's reference of a single sycl::queue of the default device. Its reference is captured in sycl::queue &q_ct1

 

But in your case, since its a multi-stream code, it would need additional queues of the same default device, for every additional stream.

 

sycl::queue *streams[num_streams];

streams[i] = dev_ct1.create_queue();

 

create_queue() will directly return a pointer to the queue of the default_device(). Since 8 streams are used, every element in the array (streams) will contain a pointer to the queue of the default device. Subsequently, submit methods to the newly created queues are called using streams[i]->submit.

 

 

Regards,

Rahul

 

 

 

0 Kudos
Highlighted
Moderator
17 Views

Hi,


Since you have accepted the solution, I'll go ahead and close this thread from my end. Intel will no longer monitor this thread. However, it will remain open for community discussion.


Feel free to post a new question, if you still face any issue.


0 Kudos