Skip to content

Add missing device info queries#2324

Open
ndgrigorian wants to merge 1 commit into
masterfrom
add-missing-device-info-queries
Open

Add missing device info queries#2324
ndgrigorian wants to merge 1 commit into
masterfrom
add-missing-device-info-queries

Conversation

@ndgrigorian

Copy link
Copy Markdown
Collaborator

This PR adds the missing SYCL 2020 spec (i.e., non-extension) device info queries to dpctl.SyclDevice

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@github-actions

Copy link
Copy Markdown

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 75.211% (-0.2%) from 75.39% — add-missing-device-info-queries into master

Comment thread dpctl/__init__.py
"backend_type",
"event_status_type",
"global_mem_cache_type",
"local_mem_type",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed to update docs/doc_sources/api_reference/dpctl/constants.rst

Comment thread dpctl/_sycl_device.pyx
if arr is not NULL and arr_len > 0:
res = []
for i in range(arr_len):
res.append(partition_property(arr[i] + 1))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to guard against possible -1 value which dpctl_partition_property_to_int can return?

EXPECT_TRUE(len > 0);
EXPECT_TRUE(arr != nullptr);
if (arr)
delete[] arr;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to use DPCTLInt_Array_Delete(arr) instead?

* @param DRef Opaque pointer to a ``sycl::device``
* @param res_len Populated with size of the returned array
* @return Returns an array of DPCTLFPConfigType values. Caller must free
* with DPCTLSize_t_Array_Delete.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* with DPCTLSize_t_Array_Delete.
* with DPCTLInt_Array_Delete.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a memory release instruction here, but not for DPCTLDevice_GetSingleFPConfig. Is that intentional?
And probably this is applicable to some other docstrings as well.

{
int *arr = nullptr;
size_t len = 0;
EXPECT_NO_FATAL_FAILURE(arr = DPCTLDevice_GetSingleFPConfig(DRef, &len));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 7 new functions which are not testing:

  • GetImageMaxBufferSize
  • GetHalfFPConfig
  • GetDoubleFPConfig
  • GetAtomicFenceOrderCapabilities
  • GetAtomicFenceScopeCapabilities
  • GetPartitionAffinityDomains
  • GetPartitionTypeAffinityDomain

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also none of 22 new API has null-DRe tests, like above ChkCopy

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

Successfully merging this pull request may close these issues.

3 participants