KhronosGroup / KhronosGroup/SYCL-Docs

Clarification needed for language restrictions related to RTTI

Open
#419 1 comment 0 reactions 0 assignees View on GitHub
clarification
Dominant language
JavaScript
Stars
158
Forks
80
Avg merge
7d 6h
Merged PRs (30d)
5

Description

The spec currently says the following in [5.4. Language restrictions for device functions](https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:language.restrictions.kernels):

https://github.com/KhronosGroup/SYCL-Docs/blob/9b616cef64dbdd658cb5fb6bcaf9e0bac22cad17/adoc/chapters/device_compiler.adoc?plain=1#L168

It is not entirely clear to me what exactly is meant by "RTTI is disabled". From what I understand, RTTI is a part of C++ language and can't be disabled from language point of view. At least I don't see anything which would suggest optionality of that functionality in [support.rtti](https://eel.is/c++draft/support.rtti), [expr.typeid](https://eel.is/c++draft/expr.typeid) or [expr.dynamic.cast](https://eel.is/c++draft/expr.dynamic.cast). Perhaps I'm missing something here?

It would be great to be more precise here with which exact C++ RTTI-related constructs are illegal in device code, such as: an `typeid` be used there? Can `dynamic_cast` be used in there?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the language-restrictions section in adoc/chapters/device_compiler.adoc at the cited line, then compare its RTTI wording with the linked C++ clauses for typeid and dynamic_cast. Clarify which RTTI-related constructs are permitted or forbidden in device code, and update the specification text so the restrictions are explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.