Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream class hangs while trying to print some floating point values #500

Closed
AlexeySachkov opened this issue Aug 13, 2019 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@AlexeySachkov
Copy link
Contributor

The following code hangs even on HOST device:

#include <CL/sycl.hpp>                                                    
                                                                          
#include <iostream>                                                       
#include <cstring>                                                        
#include <vector>                                                         
                                                                          
int main() {                                                              
  cl::sycl::queue Q;                                                      
  float FData = -1;                                                       
  std::cout << "FData: " << FData << std::endl;                           
  cl::sycl::buffer<float> Buf(&FData, cl::sycl::range<1>(1));             
                                                                          
  Q.submit([&](cl::sycl::handler &CGH) {                                  
    cl::sycl::stream S(1024, 100, CGH);                                   
    auto Acc = Buf.template get_access<cl::sycl::access::mode::read>(CGH);
    CGH.single_task<class K>([=]() {                                      
      float F = Acc[0];                                                   
      S << "F / 0 = " << (F / 0.0) << cl::sycl::endl;    
    });                                                                   
  });                                                                     
  Q.wait();                                                               
                                                                          
  return 0;                                                               
}                                                                         

If I understand correctly, F / 0.0 produces NaN and everything hangs somewhere around https://github.com/intel/llvm/blob/sycl/sycl/include/CL/sycl/detail/stream_impl.hpp#L164

@AlexeySachkov AlexeySachkov added the bug Something isn't working label Aug 13, 2019
@againull
Copy link
Contributor

Fix is merged #522

bader pushed a commit to bader/llvm that referenced this issue Jul 11, 2024
This is a refactor of intel#500 to populate function signature printing
without chaning IR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants