<commit_before>/*
Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

/**
 *  @file  hcc_detail/hip_vector_types.h
 *  @brief Defines the different newt vector types for HIP runtime.
 */

#ifndef HIP_VECTOR_TYPES_H
#define HIP_VECTOR_TYPES_H

#if defined (__HCC__) &&  (__hcc_workweek__ < 16032)
#error("This version of HIP requires a newer version of HCC.");
#endif

#if __cplusplus
#include <hc_short_vector.hpp>

using namespace hc::short_vector;
#endif

//-- Signed
// Define char vector types
typedef hc::short_vector::char1 char1;
typedef hc::short_vector::char2 char2;
typedef hc::short_vector::char3 char3;
typedef hc::short_vector::char4 char4;

// Define short vector types
typedef hc::short_vector::short1 short1;
typedef hc::short_vector::short2 short2;
typedef hc::short_vector::short3 short3;
typedef hc::short_vector::short4 short4;

// Define int vector types
typedef hc::short_vector::int1 int1;
typedef hc::short_vector::int2 int2;
typedef hc::short_vector::int3 int3;
typedef hc::short_vector::int4 int4;

// Define long vector types
typedef hc::short_vector::long1 long1;
typedef hc::short_vector::long2 long2;
typedef hc::short_vector::long3 long3;
typedef hc::short_vector::long4 long4;

// Define longlong vector types
typedef hc::short_vector::longlong1 longlong1;
typedef hc::short_vector::longlong2 longlong2;
typedef hc::short_vector::longlong3 longlong3;
typedef hc::short_vector::longlong4 longlong4;


//-- Unsigned
// Define uchar vector types
typedef hc::short_vector::uchar1 uchar1;
typedef hc::short_vector::uchar2 uchar2;
typedef hc::short_vector::uchar3 uchar3;
typedef hc::short_vector::uchar4 uchar4;

// Define ushort vector types
typedef hc::short_vector::ushort1 ushort1;
typedef hc::short_vector::ushort2 ushort2;
typedef hc::short_vector::ushort3 ushort3;
typedef hc::short_vector::ushort4 ushort4;

// Define uint vector types
typedef hc::short_vector::uint1 uint1;
typedef hc::short_vector::uint2 uint2;
typedef hc::short_vector::uint3 uint3;
typedef hc::short_vector::uint4 uint4;

// Define ulong vector types
typedef hc::short_vector::ulong1 ulong1;
typedef hc::short_vector::ulong2 ulong2;
typedef hc::short_vector::ulong3 ulong3;
typedef hc::short_vector::ulong4 ulong4;

// Define ulonglong vector types
typedef hc::short_vector::ulonglong1 ulonglong1;
typedef hc::short_vector::ulonglong2 ulonglong2;
typedef hc::short_vector::ulonglong3 ulonglong3;
typedef hc::short_vector::ulonglong4 ulonglong4;


//-- Floating point
// Define float vector types
typedef hc::short_vector::float1 float1;
typedef hc::short_vector::float2 float2;
typedef hc::short_vector::float3 float3;
typedef hc::short_vector::float4 float4;

// Define double vector types
typedef hc::short_vector::double1 double1;
typedef hc::short_vector::double2 double2;
typedef hc::short_vector::double3 double3;
typedef hc::short_vector::double4 double4;

#if __HCC__
#include"hip/hcc_detail/host_defines.h"
#define __HIP_DEVICE__ __device__ __host__
#else
#define __HIP_DEVICE__
#endif

__HIP_DEVICE__ char1 make_char1(signed char );
__HIP_DEVICE__ char2 make_char2(signed char, signed char );
__HIP_DEVICE__ char3 make_char3(signed char, signed char, signed char );
__HIP_DEVICE__ char4 make_char4(signed char, signed char, signed char, signed char );

__HIP_DEVICE__ short1 make_short1(short );
__HIP_DEVICE__ short2 make_short2(short, short );
__HIP_DEVICE__ short3 make_short3(short, short, short );
__HIP_DEVICE__ short4 make_short4(short, short, short, short );

__HIP_DEVICE__ int1 make_int1(int );
__HIP_DEVICE__ int2 make_int2(int, int );
__HIP_DEVICE__ int3 make_int3(int, int, int );
__HIP_DEVICE__ int4 make_int4(int, int, int, int );

__HIP_DEVICE__ long1 make_long1(long );
__HIP_DEVICE__ long2 make_long2(long, long );
__HIP_DEVICE__ long3 make_long3(long, long, long );
__HIP_DEVICE__ long4 make_long4(long, long, long, long );<commit_msg>added vector types for C path<commit_after>/*
Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

/**
 *  @file  hcc_detail/hip_vector_types.h
 *  @brief Defines the different newt vector types for HIP runtime.
 */

#ifndef HIP_VECTOR_TYPES_H
#define HIP_VECTOR_TYPES_H

#if defined (__HCC__) &&  (__hcc_workweek__ < 16032)
#error("This version of HIP requires a newer version of HCC.");
#endif

#if __HCC__
#include <hc_short_vector.hpp>

using namespace hc::short_vector;


//-- Signed
// Define char vector types
typedef hc::short_vector::char1 char1;
typedef hc::short_vector::char2 char2;
typedef hc::short_vector::char3 char3;
typedef hc::short_vector::char4 char4;

// Define short vector types
typedef hc::short_vector::short1 short1;
typedef hc::short_vector::short2 short2;
typedef hc::short_vector::short3 short3;
typedef hc::short_vector::short4 short4;

// Define int vector types
typedef hc::short_vector::int1 int1;
typedef hc::short_vector::int2 int2;
typedef hc::short_vector::int3 int3;
typedef hc::short_vector::int4 int4;

// Define long vector types
typedef hc::short_vector::long1 long1;
typedef hc::short_vector::long2 long2;
typedef hc::short_vector::long3 long3;
typedef hc::short_vector::long4 long4;

// Define longlong vector types
typedef hc::short_vector::longlong1 longlong1;
typedef hc::short_vector::longlong2 longlong2;
typedef hc::short_vector::longlong3 longlong3;
typedef hc::short_vector::longlong4 longlong4;


//-- Unsigned
// Define uchar vector types
typedef hc::short_vector::uchar1 uchar1;
typedef hc::short_vector::uchar2 uchar2;
typedef hc::short_vector::uchar3 uchar3;
typedef hc::short_vector::uchar4 uchar4;

// Define ushort vector types
typedef hc::short_vector::ushort1 ushort1;
typedef hc::short_vector::ushort2 ushort2;
typedef hc::short_vector::ushort3 ushort3;
typedef hc::short_vector::ushort4 ushort4;

// Define uint vector types
typedef hc::short_vector::uint1 uint1;
typedef hc::short_vector::uint2 uint2;
typedef hc::short_vector::uint3 uint3;
typedef hc::short_vector::uint4 uint4;

// Define ulong vector types
typedef hc::short_vector::ulong1 ulong1;
typedef hc::short_vector::ulong2 ulong2;
typedef hc::short_vector::ulong3 ulong3;
typedef hc::short_vector::ulong4 ulong4;

// Define ulonglong vector types
typedef hc::short_vector::ulonglong1 ulonglong1;
typedef hc::short_vector::ulonglong2 ulonglong2;
typedef hc::short_vector::ulonglong3 ulonglong3;
typedef hc::short_vector::ulonglong4 ulonglong4;


//-- Floating point
// Define float vector types
typedef hc::short_vector::float1 float1;
typedef hc::short_vector::float2 float2;
typedef hc::short_vector::float3 float3;
typedef hc::short_vector::float4 float4;

// Define double vector types
typedef hc::short_vector::double1 double1;
typedef hc::short_vector::double2 double2;
typedef hc::short_vector::double3 double3;
typedef hc::short_vector::double4 double4;

#else

#define __hip_align(name, val, data) \
    __attribute__((aligned(val))) name \
    { data }

struct __hip_align(char1, 1, signed char x;);
struct __hip_align(uchar1, 1, unsigned char x;);

struct __hip_align(char2, 2, signed char x; signed char y;);
struct __hip_align(uchar2, 2, unsigned char x; unsigned char y;);

struct char3
{
    signed char x, y, z;
};

struct uchar3
{
    unsigned char x, y, z;
};

struct __hip_align(char4, 4, signed char x; signed char y; signed char z; signed char w;);
struct __hip_align(uchar4, 4, unsigned char x; unsigned char y; unsigned char z; unsigned char w;);

struct __hip_align(short1, 2, signed short x;);
struct __hip_align(ushort1, 2, unsigned short x;);

struct __hip_align(short2, 4, signed short x; signed short y;);
struct __hip_align(ushort2, 4, unsigned short x; unsigned short y;);

struct short3
{
    signed short x, y, z;
};

struct ushort3
{
    unsigned short x, y, z;
};

struct __hip_align(short4, 8, signed short x; signed short y; signed short z; signed short w;);
struct __hip_align(ushort4, 8, unsigned short x; unsigned short y; unsigned short z; unsigned short w;);

struct __hip_align(int1, 4, signed int x;);
struct __hip_align(uint1, 4, unsigned int x;);

struct __hip_align(int2, 8, signed int x; signed int y;);
struct __hip_align(uint2, 8, unsigned int x; unsigned int y;);

struct int3{
    signed int x, y, z;
};
struct uint3{
    unsigned int x, y, z;
};

struct __hip_align(int4, 16, signed int x; signed int y; signed int z; signed int w;);
struct __hip_align(uint4, 16, unsigned int x; unsigned int y; unsigned int z; unsigned int w;);

struct __hip_align(long1, 8, long int x;);
struct __hip_align(ulong1, 8, unsigned long x;);

struct __hip_align(long2, 16, long int x; long int y;);
struct __hip_align(ulong2, 16, unsigned long x; unsigned long y;);

struct long3{
    long int x, y, z;
};
struct ulong3{
    unsigned long x, y, z;
};

struct __hip_align(long4, 32, long int x; long int y; long int z; long int w;);
struct __hip_align(ulong4, 32, unsigned long x; unsigned long y; unsigned long z; unsigned long w;);

struct float1
{
    float x;
};

struct __hip_align(float2, 8, float x; float y;);

struct float3
{
    float x, y, z;
};

struct __hip_align(float4, 16, float x; float y; float z; float w;);

struct __hip_align(longlong1, 16, long long int x;);
struct __hip_align(ulonglong1, 16, unsigned long long int x;);

struct __attribute__((aligned(32))) longlong2
{
    long long int x, y;
};

struct __attribute__((aligned(32))) ulonglong2
{
    unsigned long long int x, y;
};

struct longlong3
{
    long long int x, y, z;
};

struct ulonglong3
{
    unsigned long long int x, y, z;
};

struct __attribute__((aligned(64))) longlong4
{
    long long int x, y, z, w;
};

struct __attribute__((aligned(64))) ulonglong4
{
    unsigned long long int x, y, z, w;
};

struct double1
{
    double x;
};

struct __attribute__((aligned(16))) double2
{
    double x, y;
};

struct double3
{
    double x, y, z;
};

struct __attribute__((aligned(32))) double4
{
    double x, y, z, w;
};

#endif

#if __HCC__
#include"hip/hcc_detail/host_defines.h"
#define __HIP_DEVICE__ __device__ __host__
#else
#define __HIP_DEVICE__
#endif

__HIP_DEVICE__ char1 make_char1(signed char );
__HIP_DEVICE__ char2 make_char2(signed char, signed char );
__HIP_DEVICE__ char3 make_char3(signed char, signed char, signed char );
__HIP_DEVICE__ char4 make_char4(signed char, signed char, signed char, signed char );

__HIP_DEVICE__ short1 make_short1(short );
__HIP_DEVICE__ short2 make_short2(short, short );
__HIP_DEVICE__ short3 make_short3(short, short, short );
__HIP_DEVICE__ short4 make_short4(short, short, short, short );

__HIP_DEVICE__ int1 make_int1(int );
__HIP_DEVICE__ int2 make_int2(int, int );
__HIP_DEVICE__ int3 make_int3(int, int, int );
__HIP_DEVICE__ int4 make_int4(int, int, int, int );

__HIP_DEVICE__ long1 make_long1(long );
__HIP_DEVICE__ long2 make_long2(long, long );
__HIP_DEVICE__ long3 make_long3(long, long, long );
__HIP_DEVICE__ long4 make_long4(long, long, long, long );
{'fraction_non_alphanumeric': 0.09742519137091162, 'fraction_numerical': 0.02930487899172659, 'mean_word_length': 5.964997307485191, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '1770779', 'n_tokens_mistral': 4609, 'n_tokens_neox': 4322, 'n_words': 1435}