Open reed-lau opened 1 month ago
@hwu36
@ccecka
@hwu36 could you help to move this forward?"
This issue has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d
if there is no activity in the next 60 days.
What is your question?
With the release of Cutlass 3.6, the
print_latex
function now allows users to specify colors using a template parameter. However, theprint_svg
function's color is still hardcoded. To enhance its usability, we should extend the color parameterization feature toprint_svg
.We'll first examine how
print_latex
handles color. It uses theTikzColorFn
class as the template parameter forprint_latex
, which provides a color string for LaTeX TikZ format (e.g.,{rgb,255:red,175;green,175;blue,255}
) through theTikzColor_TV
structure's operator() function.I propose two approaches:
SvgColorFn
andSvgColor_TV
similar toTikzColorFn
andTikzColor_TV
, returning SVG-compatible color strings (e.g.,rgb(255,175,175)
). Pros: Easy to code; can be implemented by copying and modifying existing code. Cons: Color definitions would be duplicated for LaTeX and SVG.ColorFn
andColorTV
that return RGB values (int values, not color strings specific to TikZ or SVG). Theprint_latex/svg
functions would then construct the color strings for LaTeX and SVG. Pros: A unified color representation (RGB tuple with int type), making it easier for future users. Cons: More complex coding required:TikzColor_TV
toColor_TV
.TikzColor_TV
's color strings to pure RGB tuples.operator()
function to return RGB values(eg.void operator(int tid, int vid, int &r, int &g, int &b)
).print_latex
andprint_svg
construct their own color strings.TikzColorFn
toColorFn
.TikzColorWhite
andTikzColorBWx8
to RGB tuple representations.I advocate for the second approach. What are your thoughts?
Reference: https://github.com/NVIDIA/cutlass/pull/1733