Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ashishfarmer opened this issue Nov 9, 2018 · 0 comments
Assignees

Comments

@ashishfarmer
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants