<commit_before>#include "grid_gpu.cuh"
#include "halide_buf.h"

extern "C"
int nvGridder(const double _scale, const int32_t _grid_size, buffer_t *_vis_buffer, buffer_t *_gcf_buffer, buffer_t *_uvg_buffer){
  // FIXME: make gridGPUx respect buffers locations, i.e.
  // to check if they already are on GPU and skip allocation and marshaling then
  gridGPUc( _scale
          , reinterpret_cast<CmplxType*>(_uvg_buffer->host)
          , reinterpret_cast<combined*>(_vis_buffer->host)
          , _vis_buffer->extent[1]
          , _grid_size 
          , reinterpret_cast<CmplxType*>(_gcf_buffer->host)
          );
  _vis_buffer->dev = 0;
  _vis_buffer->host_dirty = false;
  _gcf_buffer->dev = 0;
  _gcf_buffer->host_dirty = false;

  _uvg_buffer->dev = 0;
  _uvg_buffer->host_dirty = false;
  _uvg_buffer->dev_dirty = false;

  return 0;
}<commit_msg>Add forgotten sort to Halide API.<commit_after>#include "grid_gpu.cuh"
#include "halide_buf.h"

extern "C"
EXPORT
int nvGridder(const double _scale, const int32_t _grid_size, buffer_t *_vis_buffer, buffer_t *_gcf_buffer, buffer_t *_uvg_buffer){
  #define visptr reinterpret_cast<combined*>(_vis_buffer->host)
  #define visnum _vis_buffer->extent[1]
  bin_sort5(visptr, visnum);
  // FIXME: make gridGPUx respect buffers locations, i.e.
  // to check if they already are on GPU and skip allocation and marshaling then
  gridGPUc( _scale
          , reinterpret_cast<CmplxType*>(_uvg_buffer->host)
          , visptr
          , visnum
          , _grid_size 
          , reinterpret_cast<CmplxType*>(_gcf_buffer->host)
          );
  _vis_buffer->dev = 0;
  _vis_buffer->host_dirty = false;
  _gcf_buffer->dev = 0;
  _gcf_buffer->host_dirty = false;

  _uvg_buffer->dev = 0;
  _uvg_buffer->host_dirty = false;
  _uvg_buffer->dev_dirty = false;

  return 0;
}
{'fraction_non_alphanumeric': 0.10773480662983426, 'fraction_numerical': 0.008287292817679558, 'mean_word_length': 3.667525773195876, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, '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': '1996116', 'n_tokens_mistral': 679, 'n_tokens_neox': 648, 'n_words': 140}