srkreddy1238 commented on code in PR #12951:
URL: https://github.com/apache/tvm/pull/12951#discussion_r984447470


##########
src/target/source/codegen_opencl.cc:
##########
@@ -89,6 +89,17 @@ void CodeGenOpenCL::InitFuncState(const PrimFunc& f) {
 
 void CodeGenOpenCL::PrintFuncPrefix() { stream << "__kernel void"; }
 
+void CodeGenOpenCL::PreFunctionBody(const PrimFunc& f) {
+  for (Var arg : f->params) {
+    auto ptr_type = arg->type_annotation.as<PointerTypeNode>();
+    if (ptr_type && 
runtime::IsTextureStorage(std::string(ptr_type->storage_scope))) {
+      this->stream << "  const sampler_t image_sampler = "

Review Comment:
   Its the first line of function body.
   
   `__kernel void kernel_name(..) {`
   `      const sampler_t image_sampler = "CLK_NORMALIZED_COORDS_FALSE | 
CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;`
   `    // ...`
   `}`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to