<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56982>56982</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
error: no viable constructor or deduction guide for deduction of template arguments of 'buffer'
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dxf2003
</td>
</tr>
</table>
<pre>
my code like this:
#include<CL/sycl.hpp>
void p(size_t number_bands){
gpu_selector selector;
queue q(selector);
auto R = range(20);
buffer number_bands1(number_bands,R);
q.submit([&](handler& h){
accessor number_bands2 (number_bands1,h,read_only);
h.parallel_for(range<1> (number_bands2),[=](id<1>n1){
"code"
});
});
}
int main(){
p(2);
}
// error: no viable constructor or deduction guide for deduction of template arguments of 'buffer'
buffer number_bands1(number_bands,R);
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9U8uSmzAQ_BpxUYWSR2DgwGGN16ec9gdcAg2gRCBWj02cr4-w1xW8tZWqXAIUekyPukdqtUZe6ulCOyORavUdqR-VI88ncmhI9UTYkbDHP3A1dzpIJLxpvhI4uUun03FZCH_eAt-MknQhUDr1C8-ezmFq0Z5bMUtHoCLF4YYblnB2qLHzxtJ7h_D3KKWvAQPS13WhezBm3-MieENfKOFHasU8YIQB2wLa0PdoH9h3EfSopnnZprymLrST8hFG8gOBPcmPsT9GrMbIvqfjtgDRdeiceeQA-oEkkjYxrbEo5NnM-rJlJKwa00VYoTXqc7-WWN7K4c0u7uvHxWBNhmZVx483dUq-Y-fdVhz95CEA63HH5jMMKY5baZ_PrsPNWavZ00moed2xDfl6-vCXtLujTvGjaO167k90NvRNiVZjNOXsvA1XZ8RPoox9ZWY6BBXt2j_MmZ56nBYtPFJhhzDh7N06S6C4mSB27jX9kysSrHf7vCrzvIR9ImsuK16JxCuvsf4vspNgdT16v7jIdNuvQfkxtGlnpjjQ-u3efFms-RavSRwq5wLGOk75viohGWvR8qwqoCsyBhnIkvdlzroWdsBklbVlokWL2tVX18OMP-h1idUo-TFRNTAAVrIivjzL074s9phBVgIHwUpOMobRBTpddaTGDomtr5LaMLgY1Mp59yconFPDjHili-vHqzwaW8ufPTDGkyt1fZX-GyYDYcM">