Skip to content

Commit

Permalink
Merge pull request #1 from DenisYaroshevskiy/substring
Browse files Browse the repository at this point in the history
Substring
  • Loading branch information
DenisYaroshevskiy authored Dec 8, 2024
2 parents 958f610 + 0ca1a88 commit 01b0bad
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<title> SIMD substring in a string </title>

<link rel="stylesheet" href="../../dist/reset.css">
<link rel="stylesheet" href="../../dist/reveal.css">
<link rel="stylesheet" href="../../dist/theme/moon.css">

<script src="https://cdn.plot.ly/plotly-2.5.0.min.js"></script>
<script> const UNSQ_EVE_COMMIT = '095883aedd2d5cd90cb59563be23e6b98e119714'; </script>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/gh/DenisYaroshevskiy/unsq_eve@095883aedd2d5cd90cb59563be23e6b98e119714/scripts/bench.js"></script>

<script src="../scripts/helper_scripts.js"></script>


<!-- Theme used for syntax highlighted code -->
<link rel="stylesheet" href="../../plugin/highlight/zenburn.css">
</head>

<body>
<div class="reveal">
<div class="slides">
<section data-transition="none">
<h2>SIMD substring in a string</h2>
<p>Denis Yaroshevskiy</p>
</section>
<section>
<h2> This talk </h2>
<ul>
<li class="fragment"> link here </li>
<li class="fragment"> interview problem </li>
<li class="fragment"> c++ standard </li>
<li class="fragment"> simd </li>
</ul>
</section>
<section>
<h2> Interview problem </h2>
<ul>
<li class="fragment"> nested loops </li>
<li class="fragment"> find + equal </li>
</ul>
</section>
<section>
<h3> substring in a string (interview) </h3>
<iframe width="1600px" height="550px"
src="https://godbolt.org/e#z:OYLghAFBqd5TKALEBjA9gEwKYFFMCWALugE4A0BIEAZgQDbYB2AhgLbYgDkAjF%2BTXRMiAZVQtGIAEwAGAUKIBVAM7YACgA9uM/gCsQPcvRZNQqAKRSAQpavlVjVEQJDqzTAGF09A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IlAhrp3Qek9F6rEJ4KE%2BpIH6Ch/qLyBtIIw3U15YwhtTDmsN4aoW4EjFGFN0aqPptjYOfo8YCkJsTUm5NKaYGprTJaFbrBMxZmzEaMNtb315vzX%2Bhh95lEARfIoktz5y0lh/c2d8eZMHVj/PIgtX6Lv/qOo2f9H4ru3ZbABW6bZ8TtpwbUqc0UYo4twN2HsvY%2B3FaYf2slA7BwgKHdk%2BxtSEtjvHRO4wU7ks0gYKQsllIyF1FnZSuprIsqZQZNlrcq6cpcnXElDc5DzWbghuySHuXEvmgS7DmKOV4bWHtTIrhOhAA%3D%3D"></iframe>
</section>
<section>
<h3> find + equal (asm) </h3>
<iframe width="1600px" height="550px"
src="https://godbolt.org/e#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:20,fontUsePx:'0',j:1,lang:c%2B%2B,selection:(endColumn:19,endLineNumber:15,positionColumn:19,positionLineNumber:15,selectionStartColumn:14,selectionStartLineNumber:15,startColumn:14,startLineNumber:15),source:'%23include+%3Calgorithm%3E%0A%23include+%3Cconcepts%3E%0A%0A%0Atemplate+%3Cstd::random_access_iterator+I1,+std::random_access_iterator+I2%3E%0AI1+search_find_equal(I1+f1,+I1+l1,+I2+f2,+I2+l2)+%7B%0A++if+(f2+%3D%3D+l2)+return+f1%3B%0A++if+(l2+-+f2+%3E+l1+-+f1)+return+l1%3B%0A%0A++I1+lf1+%3D+l1+-+(l2+-+f2)+%2B+1%3B%0A%0A++while+(true)+%7B%0A++++f1+%3D+std::find(f1,+lf1,+*f2)%3B%0A++++if+(f1+%3D%3D+lf1)+return+l1%3B%0A++++if+(std::equal(f2+%2B+1,+l2,+f1+%2B+1))+return+f1%3B%0A++++%2B%2Bf1%3B%0A++%7D%0A%7D%0A%0Aconst+char*+call(const+char*+f1,+const+char*+l1,%0A+++++++++++++++++const+char*+f2,+const+char*+l2)+%7B%0A++return+search_find_equal(f1,+l1,+f2,+l2)%3B%0A%7D'),l:'5',n:'0',o:'C%2B%2B+source+%231',t:'0')),k:33.333333333333336,l:'4',m:39.25497327592464,n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang1810,filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',debugCalls:'1',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'0',trim:'1',verboseDemangling:'0'),flagsViewOpen:'1',fontScale:20,fontUsePx:'0',j:1,lang:c%2B%2B,libs:!(),options:'-O3+--std%3Dc%2B%2B20+-march%3Dskylake+--stdlib%3Dlibc%2B%2B',overrides:!(),selection:(endColumn:23,endLineNumber:38,positionColumn:23,positionLineNumber:38,selectionStartColumn:17,selectionStartLineNumber:38,startColumn:17,startLineNumber:38),source:1),l:'5',n:'0',o:'+x86-64+clang+18.1.0+(Editor+%231)',t:'0')),header:(),l:'4',m:60.74502672407536,n:'0',o:'',s:0,t:'0')),l:'3',n:'0',o:'',t:'0')),version:4"></iframe>
</section>
</div>

<script src="../../dist/reveal.js"></script>
<script src="../../plugin/notes/notes.js"></script>
<script src="../../plugin/markdown/markdown.js"></script>
<script src="../../plugin/highlight/highlight.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,

// Learn about plugins: https://revealjs.com/plugins/
plugins: [RevealMarkdown, RevealHighlight, RevealNotes]
});
</script>
</body>

</html>
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ <h2> Conference talks</h2>
<li><a href="dyaroshev_presentations/conference_talks/my_first_simd_v2.html">My First Simd (v2)</a></li>
<li><a href="dyaroshev_presentations/conference_talks/enough_tmp_to_write_a_variant_2022.html"> Enough TMP to write a variant (2022)</a></li>
<li><a href="dyaroshev_presentations/conference_talks/advanced_simd_algorithms_in_pictures.html"> Advanced SIMD Algorithms in Pictures (2023)</a></li>
<li><a href="dyaroshev_presentations/conference_talks/simd_subsrting_in_a_string.html"> SIMD substring in a string (2025)</a></li>
</ul>
</section>
</div>
Expand Down

0 comments on commit 01b0bad

Please sign in to comment.