Skip to content

Next() is not working #12

@DryreL

Description

@DryreL

I was planning to get GPUs count.

Created a function:

`int GetGPUsCount()
{
// Call the function to initialize ADLX
if (!InitializeADLX())
{
// ADLX initialization failed, return a default value or handle the error
return -1;
}

// Get GPU list
IADLXGPUListPtr gpus;
ADLX_RESULT res = g_ADLXHelp.GetSystemServices()->GetGPUs(&gpus);

if (ADLX_SUCCEEDED(res))
{
    // Iterate through the list to count GPUs
    int gpuCount = 0;
    while (gpus->Next())
    {
        gpuCount++;
    }

    // Clean up ADLX before returning
    g_ADLXHelp.Cleanup();

    return gpuCount;
}
else
{
    // Handle the error, you might want to log or throw an exception
    std::cerr << "Failed to get GPU list" << std::endl;

    // Clean up ADLX before returning
    g_ADLXHelp.Terminate();

    return -1;
}

}
`

But Next() is not available. What should I use?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions