<commit_before>#ifndef _kernels_
#define _kernels_

#include <cstdlib>

#include <cuda_runtime.h>


namespace kernels {

  /**
   * Broadcast-add a scalar and a vector of dimension `N`.
   *
   *     dst = src_s + src_v_coeff * src_v
   */
  __global__ void add_sv(float *dst, float src_s, float src_v_coeff,
          const float *src_v, int N);

  __global__ void addi_vs(int *dst, int delta);

  /**
   * Add two vectors inplace (writing to the first).
   *
   *     v1 = v1 * v1_coeff + v2 * v2_coeff
   */
  __global__ void addi_vv(float *v1, const float *v2,
          float v1_coeff, float v2_coeff);

  /**
   * Retrieve a subset of `N` rows from the contiguous `M * D` matrix `src`
   * and write them to `dst` (`M >= N`). `dst` should be large enough to hold
   * the `N * D` float result. `idxs` should be a length-`N` int array.
   *
   * In broadcasting Python code, this function is equivalent to the following:
   *
   *     idxs_ = idxs + idx_scal_shift
   *     idxs_ += idx_vec_shift_coeff * idx_vec_shift
   *     dst = src[idxs_]
   */
  __global__ void subtensor1(float *dst, const float *src, const int *idxs,
          int N, int D, int idx_scal_shift, int idx_vec_shift_coeff,
          int *idx_vec_shift)

  /**
   * Write an int scalar into a subtensor range.
   *
   *     dst[idxs + idx_scal_shift + idx_vec_shift_coeff * idx_vec_shift] = src
   */
  __global__ void set_subtensor1i_s(int *dst, int src, const int *idxs, int N,
          int idx_scal_shift, int idx_vec_shift_coeff, int *idx_vec_shift);

  /**
   * Switch over the rows of two matrices using a mask.
   *
   *     dst = T.switch(mask, ift, iff)
   *
   * where `ift`, `iff` are `N * D` matrices, and `mask` is an `N`-dimensional
   * vector.
   */
  __global__ void switch_m(float *dst, const int *mask, const float *ift,
          const float *iff, int N, int D);

}

#endif
<commit_msg>Remove now-unused kernels from header file<commit_after>#ifndef _kernels_
#define _kernels_

#include <cstdlib>

#include <cuda_runtime.h>


namespace kernels {

  /**
   * Add two vectors inplace (writing to the first).
   *
   *     v1 = v1 * v1_coeff + v2 * v2_coeff
   */
  __global__ void addi_vv(float *v1, const float *v2,
          float v1_coeff, float v2_coeff);

  /**
   * Retrieve a subset of `N` rows from the contiguous `M * D` matrix `src`
   * and write them to `dst` (`M >= N`). `dst` should be large enough to hold
   * the `N * D` float result. `idxs` should be a length-`N` int array.
   *
   * In broadcasting Python code, this function is equivalent to the following:
   *
   *     idxs_ = idxs + idx_scal_shift
   *     idxs_ += idx_vec_shift_coeff * idx_vec_shift
   *     dst = src[idxs_]
   */
  __global__ void subtensor1(float *dst, const float *src, const int *idxs,
          int N, int D, int idx_scal_shift, int idx_vec_shift_coeff,
          int *idx_vec_shift)

  /**
   * Write an int scalar into a subtensor range.
   *
   *     dst[idxs + idx_scal_shift + idx_vec_shift_coeff * idx_vec_shift] = src
   */
  __global__ void set_subtensor1i_s(int *dst, int src, const int *idxs, int N,
          int idx_scal_shift, int idx_vec_shift_coeff, int *idx_vec_shift);

  /**
   * Switch over the rows of two matrices using a mask.
   *
   *     dst = T.switch(mask, ift, iff)
   *
   * where `ift`, `iff` are `N * D` matrices, and `mask` is an `N`-dimensional
   * vector.
   */
  __global__ void switch_m(float *dst, const int *mask, const float *ift,
          const float *iff, int N, int D);

}

#endif

{'fraction_non_alphanumeric': 0.10792388525986936, 'fraction_numerical': 0.0062482249360976995, 'mean_word_length': 2.726984126984127, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1645555', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1269, 'n_words': 411}