<commit_before>#ifndef _VIENNACL_IMAGE_OPERATIONS_HPP_
#define _VIENNACL_IMAGE_OPERATIONS_HPP_


#include "viennacl/forwards.h"
#include "viennacl/ocl/device.hpp"
#include "viennacl/ocl/handle.hpp"
#include "viennacl/ocl/kernel.hpp"
#include "viennacl/tools/tools.hpp"

#include "viennacl/linalg/kernels/image_kernels.h"
#include "viennacl/image.hpp"

namespace viennacl
{
  namespace linalg
  {

 template<cl_channel_order CHANNEL_ORDER, cl_channel_type CHANNEL_TYPE>
 void add(const viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img1,const viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img2, viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img3)
 {
  //assert(img1.size() == img2.size());
   //unsigned int size = std::min(img1.internal_size(), img2.internal_size());

  //unsigned int size = 0;
   viennacl::ocl::kernel & k = viennacl::ocl::get_kernel(viennacl::linalg::kernels::image<CHANNEL_ORDER, CHANNEL_TYPE>::program_name(), "add");

   viennacl::ocl::enqueue(k(img1, img2, img3));
 }


 template<cl_channel_order CHANNEL_ORDER, cl_channel_type CHANNEL_TYPE>
 void sub(const viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img1,const viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img2, viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img3)
    {
	  //assert(img1.size() == img2.size());
      //unsigned int size = std::min(img1.internal_size(), img2.internal_size());

	  //unsigned int size = 0;
      viennacl::ocl::kernel & k = viennacl::ocl::get_kernel(viennacl::linalg::kernels::image<CHANNEL_ORDER, CHANNEL_TYPE>::program_name(), "sub");

      viennacl::ocl::enqueue(k(img1, img2, img3));
    }

  }
}

#endif
<commit_msg>image operations. TODO: Find suitable kernels parameters as number of threads and local work group size.<commit_after>#ifndef _VIENNACL_IMAGE_OPERATIONS_HPP_
#define _VIENNACL_IMAGE_OPERATIONS_HPP_


#include "viennacl/forwards.h"
#include "viennacl/ocl/device.hpp"
#include "viennacl/ocl/handle.hpp"
#include "viennacl/ocl/kernel.hpp"
#include "viennacl/tools/tools.hpp"

#include "viennacl/linalg/kernels/image_kernels.h"
#include "viennacl/image.hpp"

namespace viennacl
{
  namespace linalg
  {

 template<cl_channel_order CHANNEL_ORDER, cl_channel_type CHANNEL_TYPE>
 void add(const viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img1,const viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img2, viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img3)
 {
   viennacl::ocl::kernel & k = viennacl::ocl::get_kernel(viennacl::linalg::kernels::image<CHANNEL_ORDER, CHANNEL_TYPE>::program_name(), "add");
   k.global_work_size(0,128);
   k.global_work_size(1,128);
   k.local_work_size(0,16);
   k.local_work_size(1,16);
   viennacl::ocl::enqueue(k(img1, img2, img3));
 }


 template<cl_channel_order CHANNEL_ORDER, cl_channel_type CHANNEL_TYPE>
 void sub(const viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img1,const viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img2, viennacl::image<CHANNEL_ORDER, CHANNEL_TYPE> & img3)
    {
      viennacl::ocl::kernel & k = viennacl::ocl::get_kernel( viennacl::linalg::kernels::image<CHANNEL_ORDER, CHANNEL_TYPE>::program_name(), "sub");
      k.global_work_size(0,128);
      k.global_work_size(1,128);
      k.local_work_size(0,16);
      k.local_work_size(1,16);
      viennacl::ocl::enqueue(k(img1, img2, img3));
    }

  }
}

#endif

{'fraction_non_alphanumeric': 0.14397826743133113, 'fraction_numerical': 0.018714156353757925, 'mean_word_length': 6.364444444444445, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1770124', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1227, 'n_words': 184}