Skip to content

SPIR-V validation error when running Kmeans kernel #88

@diptorupd

Description

@diptorupd

Numba-PVC produces the following error when running kmeans. The error message is continuously printed on stdout and the process has to be killed to stop execution.

error: line 164: ID 71[%_323_i] has not been defined
%_324_i = OpLoad %float %_323_i Aligned 4
SPIR-V Validation failed...
error: line 164: ID 71[%_323_i] has not been defined
%_324_i = OpLoad %float %_323_i Aligned 4

......

To perform a preliminary triage, I reduced the kmeans program to a single kernel. The kernel code is attached below.

@dppy.kernel
def groupByCluster(arrayP, arrayPcluster,
                   arrayC,
                   num_points, num_centroids):
    idx = dppy.get_global_id(0)

    if idx < num_points:
        minor_distance = -1

        for i in range(num_centroids):
            dx = arrayP[idx, 0] - arrayC[i, 0]
            dy = arrayP[idx, 1] - arrayC[i, 1]
            my_distance = sqrt(dx * dx + dy * dy)

            if minor_distance > my_distance or minor_distance == -1:
                minor_distance = my_distance
                arrayPcluster[idx] = i

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions