Skip to content

Instance won't be None #191

@LiuLiujie

Description

@LiuLiujie

In the code fragment below, the instance won't be None in line 764 because the function dev.create_kernel_instance(_) returns either InvalidConfig or KernelInstance.

When I make a problem in the thread block settings, the return value in line 763 is an instance of InvalidConfig, which has no attribute name, bypasses the if statement, and will cause error AttributeError: 'InvalidConfig' object has no attribute 'name' in line 768. This error message is not that clear for me to figure out what the real problem is.

instance = dev.create_kernel_instance(kernelsource, kernel_options, params, False)
if instance is None:
raise RuntimeError("cannot create kernel instance, too many threads per block")
# see if the kernel arguments have correct type
util.check_argument_list(instance.name, instance.kernel_string, arguments)

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