Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

Segmentation fault while running thrust::lower bound in a HIP kernel #14

Description

@ashishfarmer

Having a HIP Kernel with thrust::lower_bound causes a crash. The same call if used in the host code and not a HIP kernel works ok!

A simple test that causes a crash is:

#include <thrust/binary_search.h>
#include <thrust/execution_policy.h>
#include <thrust/functional.h>
#include "hip/hip_runtime.h"

__global__ void kern(
        int N,
        float* inp,
        float val)
{
        auto low_bound = thrust::lower_bound(thrust::device, inp, inp + N, val);

}

int main(void)
{      
        float * input_device;
        hipMalloc(&input_device, sizeof(float)*6);
        float value = 5;
        hipLaunchKernelGGL(HIP_KERNEL_NAME(kern), dim3(1), dim3(1), 0,0,6, input_device, value);
        hipFree(input_device);

        return 0;
}

I compiled the code using hipcc

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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