Skip to content

gh-886: Added 3 new device attributes and kernel's device-specific attributes - #894

Merged
oleksandr-pavlyk merged 11 commits into
masterfrom
gh-886-more-device-attributes
Sep 4, 2022
Merged

oleksandr-pavlyk merged 11 commits into
masterfrom
gh-886-more-device-attributes

Conversation

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

Closes #886

These are DPCTLDevice_GetGlobalMemCacheSize, DPCTLDevice_GlobalMemCacheLineSize,
and DPCTLDevice_GetGlobalMemCacheType.

To support the latter, introduced DPCTLGlobalMemCacheType enum in "dpctl_sycl_enum_types.h".

Tests are added to test_capi target.

  • 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?
  • If this PR is a work in progress, are you filing the PR as a draft?

@github-actions

Copy link
Copy Markdown

@oleksandr-pavlyk
oleksandr-pavlyk force-pushed the gh-886-more-device-attributes branch 3 times, most recently from 103e9ee to f6369f2 Compare August 26, 2022 20:12
@coveralls

coveralls commented Aug 26, 2022 •

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage decreased (-0.01%) to 81.829% when pulling 706237c on gh-886-more-device-attributes into 8655e98 on master.

@oleksandr-pavlyk oleksandr-pavlyk mentioned this pull request Aug 27, 2022
1 task done
These are DPCTLDevice_GetGlobalMemCacheSize, DPCTLDevice_GlobalMemCacheLineSize,
and DPCTLDevice_GetGlobalMemCacheType.

To support the latter, introduced DPCTLGlobalMemCacheType enum in dpctl_sycl_enum_types.h

Tests are added to test_capi target.
@oleksandr-pavlyk
oleksandr-pavlyk force-pushed the gh-886-more-device-attributes branch from f6369f2 to fc0e4b2 Compare August 28, 2022 16:35
@oleksandr-pavlyk
oleksandr-pavlyk force-pushed the gh-886-more-device-attributes branch from 6c1b5b8 to 6082c0b Compare August 28, 2022 22:55
  * dpctl.SyclDevice.global_mem_cache_size
  * dpctl.SyclDevice.global_mem_cache_line_size
  * dpctl.SyclDevice.global_mem_cache_type

The last property output is a new enum dpctl.global_mem_cache_type
which can assume 3 values: none, read_only, and read_write
@oleksandr-pavlyk
oleksandr-pavlyk force-pushed the gh-886-more-device-attributes branch from 6082c0b to bcf1a14 Compare August 28, 2022 23:27
@oleksandr-pavlyk
oleksandr-pavlyk force-pushed the gh-886-more-device-attributes branch from c3a6d4e to 2870b50 Compare August 30, 2022 01:03
@oleksandr-pavlyk
oleksandr-pavlyk marked this pull request as ready for review August 30, 2022 14:56
@oleksandr-pavlyk oleksandr-pavlyk changed the title Added 3 new device attributes per gh-886 gh-886: Added 3 new device attributes and kernel's device-specific attributes Sep 3, 2022
Comment thread dpctl/_sycl_device.pyx Outdated
int: Cache size in bytes
"""
cdef uint64_t cache_sz = DPCTLDevice_GetGlobalMemCacheSize(
self._device_ref)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

close paren should be on next line.

Comment thread dpctl/_sycl_device.pyx Outdated
int: Cache size in bytes
"""
cdef uint64_t cache_line_sz = DPCTLDevice_GetGlobalMemCacheLineSize(
self._device_ref)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same formatting change here

Comment thread dpctl/program/_program.pyx Outdated
a multiple, for executing the kernel on the device it was built for.
"""
cdef size_t v = DPCTLKernel_GetPreferredWorkGroupSizeMultiple(
self._kernel_ref)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

formatting

@diptorupd diptorupd Sep 4, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also the explanation reads a bit awkward. How about:

Returns a number whose multiple is the preferred work-group size for the specified kernel on the selected device.

* interoperability kernel.
*
* @param KRef DPCTLSyclKernelRef pointer to an OpenCL
* @param KRef DPCTLSyclKernelRef pointer to an SYCL

@diptorupd diptorupd Sep 4, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo: to a SYCL

* ``sycl::kernel``.
*
* @param KRef DPCTLSyclKernelRef pointer to an OpenCL
* @param KRef DPCTLSyclKernelRef pointer to an SYCL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same typo

*
* @param KRef DPCTLSyclKernelRef pointer to an SYCL
* interoperability kernel.
* @return Returns a value, of which work-group size is preferred to be a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My reuse the docstring from the Python function corresponding to the C API function.

diptorupd
diptorupd previously approved these changes Sep 4, 2022

@diptorupd diptorupd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank! Please fix the minor typo etc. and merge.

@oleksandr-pavlyk
oleksandr-pavlyk merged commit f48cf30 into master Sep 4, 2022
@oleksandr-pavlyk
oleksandr-pavlyk deleted the gh-886-more-device-attributes branch September 4, 2022 13:25
@github-actions

github-actions Bot commented Sep 4, 2022

Copy link
Copy Markdown

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

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.

Request for additonal attribute preferred_work_group_size_multiple

3 participants