Skip to content

Enable support for multiple kernels for xeus-cpp-lite #290

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anutosh491
Copy link
Collaborator

@anutosh491 anutosh491 commented Apr 17, 2025

Description

Fixes #185

Type of change

Please tick all options which are relevant.

  • Bug fix
  • New feature
  • Added/removed dependencies
  • Required documentation updates

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2025

Codecov Report

Attention: Patch coverage is 9.09091% with 10 lines in your changes missing coverage. Please review.

Project coverage is 81.30%. Comparing base (160dce0) to head (3ffa196).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/xutils.cpp 0.00% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
- Coverage   82.15%   81.30%   -0.85%     
==========================================
  Files          20       20              
  Lines         958      968      +10     
  Branches       88       88              
==========================================
  Hits          787      787              
- Misses        171      181      +10     
Files with missing lines Coverage Δ
src/xinterpreter.cpp 91.20% <100.00%> (ø)
src/xutils.cpp 57.14% <0.00%> (-17.86%) ⬇️
Files with missing lines Coverage Δ
src/xinterpreter.cpp 91.20% <100.00%> (ø)
src/xutils.cpp 57.14% <0.00%> (-17.86%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@anutosh491
Copy link
Collaborator Author

anutosh491 commented Apr 17, 2025

Screen.Recording.2025-04-17.at.1.47.31.PM.mp4

Demo above : Shows 3 xeus-cpp-lite kernels built (all use different flags -std=c++17/20/23)

On top of which xcpp20 is built using the -msimd128 flag (required for running simd code in the browser)

  "argv": [
      "@XEUS_CPP_KERNELSPEC_PATH@xcpp",
      "-resource-dir", "@XEUS_CPP_RESOURCE_DIR@",
      "-std=c++20", "-msimd128"
  ],
  
// instead of 

  "argv": [
      "@XEUS_CPP_KERNELSPEC_PATH@xcpp",
      "-resource-dir", "@XEUS_CPP_RESOURCE_DIR@",
      "-std=c++23", 
  ],

So xcpp20 kernel would work but xcpp23 wouldn't !

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -19,7 +19,7 @@ namespace xcpp
{
public:

wasm_interpreter();
wasm_interpreter(const std::vector<std::string>& args);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::string" is directly included [misc-include-cleaner]

include/xeus-cpp/xinterpreter_wasm.hpp:14:

+ #include <string>

@@ -19,7 +19,7 @@
{
public:

wasm_interpreter();
wasm_interpreter(const std::vector<std::string>& args);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::vector" is directly included [misc-include-cleaner]

include/xeus-cpp/xinterpreter_wasm.hpp:14:

+ #include <vector>

@@ -32,6 +32,9 @@ namespace xcpp

XEUS_CPP_API
std::string retrieve_tagfile_dir();

XEUS_CPP_API
std::pair<int, char**> convert_to_argv(const std::vector<std::string>& args);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::pair" is directly included [misc-include-cleaner]

include/xeus-cpp/xutils.hpp:12:

+ #include <utility>

@@ -32,6 +32,9 @@

XEUS_CPP_API
std::string retrieve_tagfile_dir();

XEUS_CPP_API
std::pair<int, char**> convert_to_argv(const std::vector<std::string>& args);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::vector" is directly included [misc-include-cleaner]

include/xeus-cpp/xutils.hpp:12:

+ #include <vector>

: interpreter(0, nullptr)
{
}
wasm_interpreter::wasm_interpreter(const std::vector<std::string>& args)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::string" is directly included [misc-include-cleaner]

src/xinterpreter_wasm.cpp:15:

+ #include <string>

: interpreter(0, nullptr)
{
}
wasm_interpreter::wasm_interpreter(const std::vector<std::string>& args)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "std::vector" is directly included [misc-include-cleaner]

src/xinterpreter_wasm.cpp:15:

+ #include <vector>


return {
static_cast<int>(argv_vec.size()),
const_cast<char**>(argv_vec.data())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: do not use const_cast to remove const qualifier [cppcoreguidelines-pro-type-const-cast]

            const_cast<char**>(argv_vec.data())
            ^

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.

Fix kernel configuration for xeus-cpp-lite
3 participants