<commit_before>/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*   File:         kmeans.h   (an OpenMP version)                            */
/*   Description:  header file for a simple k-means clustering program       */
/*                                                                           */
/*   Author:  <NAME>                                                  */
/*            ECE Department Northwestern University                         */
/*            email: <EMAIL>                             */
/*   Copyright, 2005, <NAME>                                          */
/*                                                                           */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef _H_KMEANS
#define _H_KMEANS

#include <assert.h>

float** omp_kmeans(int, float**, int, int, int, float, int*);
float** seq_kmeans(float**, int, int, int, float, int*);
float** cuda_kmeans(float**, int, int, int, float, int*);

float** file_read(int, char*, int*, int*);
int     file_write(char*, int, int, int, float**, int*);


double  wtime(void);

extern int _debug;

#endif
<commit_msg>CUDA helpers<commit_after>/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*   File:         kmeans.h   (an OpenMP version)                            */
/*   Description:  header file for a simple k-means clustering program       */
/*                                                                           */
/*   Author:  <NAME>                                                  */
/*            ECE Department Northwestern University                         */
/*            email: <EMAIL>                             */
/*   Copyright, 2005, <NAME>                                          */
/*                                                                           */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef _H_KMEANS
#define _H_KMEANS

#include <assert.h>

#define msg(format, ...)    { fprintf(stderr, format, ##__VA_ARGS__); }
#define err(format, ...)    { fprintf(stderr, format, ##__VA_ARGS__); exit(1); }

#ifdef __CUDACC__
inline void checkCuda(cudaError_t e) {
    if (e != cudaSuccess) {
        err("CUDA Error: %s\n", cudaGetErrorString(e))
    }
}

inline void checkLastCudaError() {
    checkCuda(cudaGetLastError());
}
#endif

float** omp_kmeans(int, float**, int, int, int, float, int*);
float** seq_kmeans(float**, int, int, int, float, int*);
float** cuda_kmeans(float**, int, int, int, float, int*);

float** file_read(int, char*, int*, int*);
int     file_write(char*, int, int, int, float**, int*);


double  wtime(void);

extern int _debug;

#endif

{'fraction_non_alphanumeric': 0.1749271137026239, 'fraction_numerical': 0.0032798833819241984, 'mean_word_length': 1.2648514851485149, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3759678', 'n_tokens_mistral': 836, 'n_tokens_neox': 801, 'n_words': 174}