Writing your own code
Creating GPU-accelerated programs is different from sequential CPU code, but there is an interesting software engineering aspect that is constant in both worlds: we must consider when we should write our own code and when to use an existing library. In large, enterprise-level, projects we try to avoid reinventing the wheel as much as possible, for many reasons. One of them we already discussed on the previous section: a library tends to have a dedicated team that is specialized in the library’s domain. This means that its business is the library, while most of the time our business is an application for a specific case that will make use of the library to achieve our results. Another reason is that when we decide to create code that competes with libraries we may take on responsibility for maintaining that code, and our ability to discharge that responsibility effectively can be affected by many factors. We may have less time to correct a specific bug...