Skip to content

Feature/extra device info #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

diptorupd
Copy link
Contributor

The PR closes issues #113 and #81.

Sycl device class provides several info device descriptors that can be extracted using info::device. This PR will expose several of the device descriptors inside dpctl C API (backends) and inside the dpctl.SyclDevice class.

  • info::device::max_compute_units
  • info::device::max_work_item_dimensions
  • info::device::max_work_item_sizes
  • info::device::max_work_group_size
  • info::device::max_num_sub_groups
  • info::device::half_fp_config
  • info::device::single_fp_config
  • info::device::double_fp_config
  • info::device::aspects
    • int64_base_atomics
    • int64_extended_atomics

These attributes are needed inside Numba and possibly by other clients of dpctl to determine device capabilities.

@diptorupd diptorupd marked this pull request as draft October 7, 2020 03:51
@1e-to
Copy link
Contributor

1e-to commented Oct 8, 2020

info::device::half_fp_config
info::device::single_fp_config
info::device::double_fp_config

These descriptors return std::vector, further research is needed to select an implementation

@diptorupd diptorupd marked this pull request as ready for review October 13, 2020 15:35
@1e-to
Copy link
Contributor

1e-to commented Oct 13, 2020

Continued work here diptorupd#6

return unwrap(DRef)->is_gpu();
auto D = unwrap(DRef);
if(D) {
return unwrap(DRef)->is_gpu();
Copy link
Contributor

Choose a reason for hiding this comment

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

Use D.

void DPPLSize_t_Array_Delete (__dppl_take size_t* arr)
{
delete[] arr;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

* @brief Wrapper for get_info<info::device::max_work_item_sizes().
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the valid result if device exists else returns Null.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @return Returns the valid result if device exists else returns Null.
* @return Returns the valid result if device exists else returns NULL.

return cstr_name;
auto D = unwrap(DRef);
if(D) {
auto name = unwrap(DRef)->get_info<info::device::name>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Use D.

return cstr_vendor;
auto D = unwrap(DRef);
if(D) {
auto vendor = unwrap(DRef)->get_info<info::device::name>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Use D.

std::strcpy (cstr_driver, driver.c_str());
return cstr_driver;
auto D = unwrap(DRef);
if(D) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(D) {
if (D) {

@@ -0,0 +1,230 @@
//===----- test_sycl_device_interface.cpp - DPPL-SYCL interface -*- C++ -*-===//
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//===----- test_sycl_device_interface.cpp - DPPL-SYCL interface -*- C++ -*-===//
//===----- test_sycl_device_interface.cpp - dpctl-C_API interface -*- C++ -*-===//

Change it in all changed files to be like in other existing files in backend.

///
/// \file
/// This file has unit test cases for functions defined in
/// dppl_sycl_kernel_interface.h.
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the comment.

@PokhodenkoSA
Copy link
Contributor

@1e-to is it a duplication with #147 ?

@diptorupd
Copy link
Contributor Author

Closing in favor of #147

@diptorupd diptorupd closed this Oct 21, 2020
@diptorupd diptorupd deleted the feature/extra_device_info branch October 30, 2020 00:44
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