Skip to content

Define helper functions for CUDA Kernel #8

@JerryI

Description

@JerryI

Hi there,

I faced an issue when tried to define a helper function for my CUDA Kernel like

inline __host__ __device__ float4 operator+(float4 a, float4 b)
{
    return make_float4(a.x + b.x, a.y + b.y, a.z + b.z,  a.w + b.w);
}

And then got

input_line_11:3:1: error: function definition is not allowed here
{

Is it a drawback of a runtime CUDA compilation?

Btw/ This is an amazing project! Thanks a lot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions