<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 08/17/2017 07:34 AM, Francois Fayard
      via llvm-dev wrote:<br>
    </div>
    <blockquote
      cite="mid:D8B10F09-1FAF-4EB2-8E10-E602B85E61AA@insideloop.io"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <br class="">
      <blockquote type="cite" class="">You can imagine a community the
        size of LLVM's having to rely on<br class="">
        external libraries that may have the same goals today, but
        different<br class="">
        paths tomorrow. The end result is the same: a fork for the
        things that<br class="">
        matter to us, just like we've done with the standard library.<br
          class="">
        <br class="">
        All in all, your library looks really nice, and it does solve an<br
          class="">
        intersection of the problems we also solve, probably in very
        similar<br class="">
        ways, but that doesn't mean source code can be shared at that
        level.<br class="">
        There are other factors at play which have nothing to do with
        solving<br class="">
        problems.<br class="">
      </blockquote>
      <div class=""><br class="">
      </div>
      I agree with you. And I never thought that sharing the same source
      code could be something that can be done.
      <div class="">
        <div class=""><br class="">
        </div>
        <div class="">But sharing ideas, implementation tricks,
          algorithms (I am thinking about all the probing methods
          available in open addressing) might be helpful. That’s were we
          can share ideas. Scientific computing is more and more about
          computing on strings (think DNA), and data structures such as
          graphs which are not as simple as the good old days where BLAS
          workloads where the only ones.</div>
        <div class=""><br class="">
        </div>
        <div class="">To be honest, I’d like to get the best of ADT and
          understand the rationale behind some choices. In return, I
          might bring you some time to test new ideas and I can try to
          give ideas that could also be implemented in LLVM. For me,
          what is time consuming is not coding, but designing APIs that
          are both easy to use, difficult to misuse, and don’t lock
          performance. Getting the 3 of them right (or as close as you
          can) is really hard work.</div>
        <div class="">Just to give, you an idea, here is how my hash map
          works if you want to do memoization</div>
        <div class="">=====</div>
        <div class="">B f(A x);</div>
        <div class=""><br class="">
        </div>
        <div class="">il::Map<A, B> map{};</div>
        <div class=""><br class="">
        </div>
        <div class="">B f_memoization(A x) {</div>
        <div class="">  // If x is in the map, i is the slot where the
          key, value pair is</div>
        <div class="">  // It it is not the case, it is the place where
          it should be inserted</div>
        <div class="">  // All in all, this algo, hashes x and runs the
          hash table only one</div>
        <div class="">  const int i = map.search(x);</div>
        <div class="">  if (!map.found(x)) {</div>
        <div class="">    map.insert(x, f(x), i);</div>
        <div class="">  }</div>
        <div class="">  return map.value(i);</div>
        <div class="">}</div>
        <div class="">=====</div>
        <div class="">Doing the same with the STL is just painful. This
          example by the way comes from one of Chandler Carruth’s talk.</div>
        <div class=""><br class="">
        </div>
        <div class="">What I am looking for is sharing ideas, running
          some benchmarks, working on pros and cons of APIs on a
          performance point of view, etc. It anyone think that this
          could be helpful, it would be great.</div>
      </div>
    </blockquote>
    <br>
    Speaking of benchmarks, we might be able use the library, or some
    parts of it, in our test suite for correctness and performance
    testing. I see some stand-alone benchmarks that seem useful (e.g.,
<a class="moz-txt-link-freetext" href="https://github.com/insideloop/InsideLoop/blob/master/il/benchmark/types/32-vs-64-bit-integers.cpp">https://github.com/insideloop/InsideLoop/blob/master/il/benchmark/types/32-vs-64-bit-integers.cpp</a>)
    but also some of the numeric things (e.g.
<a class="moz-txt-link-freetext" href="https://github.com/insideloop/InsideLoop/blob/master/il/benchmark/memory/matrix_multiplication.cpp">https://github.com/insideloop/InsideLoop/blob/master/il/benchmark/memory/matrix_multiplication.cpp</a>
    which makes use of SIMD pragmas and vector intrinsics). Something
    with the hash tables and multi-dimensional arrays could be useful
    too.<br>
    <br>
    If you're interested (or anyone else is), I'm happy to chat more
    about the details.<br>
    <br>
     -Hal<br>
    <br>
    <blockquote
      cite="mid:D8B10F09-1FAF-4EB2-8E10-E602B85E61AA@insideloop.io"
      type="cite">
      <div class="">
        <div class="">
          <div class=""><br class="">
            <div class="">
              <div style="color: rgb(0, 0, 0); letter-spacing: normal;
                orphans: auto; text-align: start; text-indent: 0px;
                text-transform: none; white-space: normal; widows: auto;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                word-wrap: break-word; -webkit-nbsp-mode: space;
                -webkit-line-break: after-white-space;" class="">
                <div style="color: rgb(0, 0, 0); letter-spacing: normal;
                  orphans: auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; word-wrap: break-word; -webkit-nbsp-mode: space;
                  -webkit-line-break: after-white-space;" class="">François
                  Fayard</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </body>
</html>