From c8c1b729648b0b839c1c87266b6599ae11dfa881 Mon Sep 17 00:00:00 2001 From: Guillermo Arrieta Medina Date: Fri, 6 Mar 2026 11:58:45 -0600 Subject: [PATCH 1/2] =?UTF-8?q?Pruebas=20de=20generaci=C3=B3n=20de=20bibli?= =?UTF-8?q?ograf=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/copilot-instructions.md | 100 + deno.lock | 8 + notebooks/apa.csl | 2273 +++++++++++++++ notebooks/chicago-author-date.csl | 4189 +++++++++++++++++++++++++++ notebooks/google_boks_api.ipynb | 1242 ++++++++ notebooks/ieee.csl | 519 ++++ notebooks/locales-es-MX.xml | 757 +++++ notebooks/nlm-citation-sequence.csl | 520 ++++ package.json | 1 + 9 files changed, 9609 insertions(+) create mode 100644 .github/copilot-instructions.md create mode 100644 notebooks/apa.csl create mode 100644 notebooks/chicago-author-date.csl create mode 100644 notebooks/google_boks_api.ipynb create mode 100644 notebooks/ieee.csl create mode 100644 notebooks/locales-es-MX.xml create mode 100644 notebooks/nlm-citation-sequence.csl diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..ae41965 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,100 @@ +# Writing Supabase Edge Functions + +You're an expert in writing TypeScript and Deno JavaScript runtime. Generate **high-quality Supabase Edge Functions** that adhere to the following best practices: + +## Guidelines + +1. Try to use Web APIs and Deno’s core APIs instead of external dependencies (eg: use fetch instead of Axios, use WebSockets API instead of node-ws) +2. If you are reusing utility methods between Edge Functions, add them to `supabase/functions/_shared` and import using a relative path. Do NOT have cross dependencies between Edge Functions. +3. Do NOT use bare specifiers when importing dependencies. If you need to use an external dependency, make sure it's prefixed with either `npm:` or `jsr:`. For example, `@supabase/supabase-js` should be written as `npm:@supabase/supabase-js`. +4. For external imports, always define a version. For example, `npm:@express` should be written as `npm:express@4.18.2`. +5. For external dependencies, importing via `npm:` and `jsr:` is preferred. Minimize the use of imports from @`deno.land/x` , `esm.sh` and @`unpkg.com` . If you have a package from one of those CDNs, you can replace the CDN hostname with `npm:` specifier. +6. You can also use Node built-in APIs. You will need to import them using `node:` specifier. For example, to import Node process: `import process from "node:process". Use Node APIs when you find gaps in Deno APIs. +7. Do NOT use `import { serve } from "https://deno.land/std@0.168.0/http/server.ts"`. Instead use the built-in `Deno.serve`. +8. Following environment variables (ie. secrets) are pre-populated in both local and hosted Supabase environments. Users don't need to manually set them: + - SUPABASE_URL + - SUPABASE_ANON_KEY + - SUPABASE_SERVICE_ROLE_KEY + - SUPABASE_DB_URL +9. To set other environment variables (ie. secrets) users can put them in a env file and run the `supabase secrets set --env-file path/to/env-file` +10. A single Edge Function can handle multiple routes. It is recommended to use a library like Express or Hono to handle the routes as it's easier for developer to understand and maintain. Each route must be prefixed with `/function-name` so they are routed correctly. +11. File write operations are ONLY permitted on `/tmp` directory. You can use either Deno or Node File APIs. +12. Use `EdgeRuntime.waitUntil(promise)` static method to run long-running tasks in the background without blocking response to a request. Do NOT assume it is available in the request / execution context. + +## Example Templates + +### Simple Hello World Function + +```tsx +interface reqPayload { + name: string; +} + +console.info("server started"); + +Deno.serve(async (req: Request) => { + const { name }: reqPayload = await req.json(); + const data = { + message: `Hello ${name} from foo!`, + }; + + return new Response(JSON.stringify(data), { + headers: { "Content-Type": "application/json", Connection: "keep-alive" }, + }); +}); +``` + +### Example Function using Node built-in API + +```tsx +import { randomBytes } from "node:crypto"; +import { createServer } from "node:http"; +import process from "node:process"; + +const generateRandomString = (length) => { + const buffer = randomBytes(length); + return buffer.toString("hex"); +}; + +const randomString = generateRandomString(10); +console.log(randomString); + +const server = createServer((req, res) => { + const message = `Hello`; + res.end(message); +}); + +server.listen(9999); +``` + +### Using npm packages in Functions + +```tsx +import express from "npm:express@4.18.2"; + +const app = express(); + +app.get(/(.*)/, (req, res) => { + res.send("Welcome to Supabase"); +}); + +app.listen(8000); +``` + +### Generate embeddings using built-in @Supabase.ai API + +```tsx +const model = new Supabase.ai.Session("gte-small"); + +Deno.serve(async (req: Request) => { + const params = new URL(req.url).searchParams; + const input = params.get("text"); + const output = await model.run(input, { mean_pool: true, normalize: true }); + return new Response(JSON.stringify(output), { + headers: { + "Content-Type": "application/json", + Connection: "keep-alive", + }, + }); +}); +``` diff --git a/deno.lock b/deno.lock index aaf39da..4d7cc8b 100644 --- a/deno.lock +++ b/deno.lock @@ -23,6 +23,7 @@ "npm:@supabase/supabase-js@^2.90.1": "2.90.1", "npm:@toon-format/toon@^2.1.0": "2.1.0", "npm:@types/bun@^1.3.5": "1.3.5", + "npm:citeproc@^2.4.63": "2.4.63", "npm:deno@^2.6.4": "2.6.4", "npm:jwt-decode@4": "4.0.0", "npm:openai@6.16.0": "6.16.0_zod@3.25.76", @@ -263,6 +264,9 @@ "chownr@3.0.0": { "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==" }, + "citeproc@2.4.63": { + "integrity": "sha512-68F95Bp4UbgZU/DBUGQn0qV3HDZLCdI9+Bb2ByrTaNJDL5VEm9LqaiNaxljsvoaExSLEXe1/r6n2Z06SCzW3/Q==" + }, "cmd-shim@8.0.0": { "integrity": "sha512-Jk/BK6NCapZ58BKUxlSI+ouKRbjH1NLZCgJkYoab+vEHUY3f6OzpNBN9u7HFSv9J6TRDGs4PLOHezoKGaFRSCA==" }, @@ -573,6 +577,9 @@ } }, "remote": { + "https://deno.land/std@0.224.0/dotenv/mod.ts": "0180eaeedaaf88647318811cdaa418cc64dc51fb08354f91f5f480d0a1309f7d", + "https://deno.land/std@0.224.0/dotenv/parse.ts": "09977ff88dfd1f24f9973a338f0f91bbdb9307eb5ff6085446e7c423e4c7ba0c", + "https://deno.land/std@0.224.0/dotenv/stringify.ts": "275da322c409170160440836342eaa7cf012a1d11a7e700d8ca4e7f2f8aa4615", "https://deno.land/x/zod@v3.22.4/ZodError.ts": "4de18ff525e75a0315f2c12066b77b5c2ae18c7c15ef7df7e165d63536fdf2ea", "https://deno.land/x/zod@v3.22.4/errors.ts": "5285922d2be9700cc0c70c95e4858952b07ae193aa0224be3cbd5cd5567eabef", "https://deno.land/x/zod@v3.22.4/external.ts": "a6cfbd61e9e097d5f42f8a7ed6f92f93f51ff927d29c9fbaec04f03cbce130fe", @@ -601,6 +608,7 @@ "npm:@supabase/supabase-js@^2.90.1", "npm:@toon-format/toon@^2.1.0", "npm:@types/bun@^1.3.5", + "npm:citeproc@^2.4.63", "npm:deno@^2.6.4", "npm:jwt-decode@4", "npm:openai@^6.16.0", diff --git a/notebooks/apa.csl b/notebooks/apa.csl new file mode 100644 index 0000000..9bc45ef --- /dev/null +++ b/notebooks/apa.csl @@ -0,0 +1,2273 @@ + + diff --git a/notebooks/chicago-author-date.csl b/notebooks/chicago-author-date.csl new file mode 100644 index 0000000..d29fadb --- /dev/null +++ b/notebooks/chicago-author-date.csl @@ -0,0 +1,4189 @@ + + diff --git a/notebooks/google_boks_api.ipynb b/notebooks/google_boks_api.ipynb new file mode 100644 index 0000000..e7ddff0 --- /dev/null +++ b/notebooks/google_boks_api.ipynb @@ -0,0 +1,1242 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "dcded768", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Variables de entorno cargadas.\n" + ] + } + ], + "source": [ + "import { load } from \"https://deno.land/std@0.224.0/dotenv/mod.ts\";\n", + "\n", + "// Carga el .env en Deno.env (envuelto en try-catch)\n", + "try {\n", + " // Intentamos cargar y exportar las variables de entorno\n", + " await load({ export: true });\n", + " console.log(\"Variables de entorno cargadas.\");\n", + "} catch (e) {\n", + " console.log(\"No se pudo cargar las variables de entorno (.env)\");\n", + "}\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "009c2b89", + "metadata": {}, + "outputs": [], + "source": [ + "async function buscarBibliografia(query) {\n", + " // maxResults define cuántos libros quieres obtener (máximo 40)\n", + " const url = `https://www.googleapis.com/books/v1/volumes?q=${\n", + " encodeURIComponent(query)\n", + " }&maxResults=10`;\n", + "\n", + " try {\n", + " const response = await fetch(url);\n", + " if (!response.ok) {\n", + " throw new Error(`Error en la petición: ${response.status}`);\n", + " }\n", + "\n", + " const data = await response.json();\n", + "\n", + " if (!data.items) return []; // Retorna vacío si no hay resultados\n", + "\n", + " // Mapeamos el JSON para extraer solo la información útil para el RAG\n", + " const libros = data.items.map((item) => {\n", + " return {\n", + " ...item,\n", + " };\n", + " });\n", + "\n", + " return libros;\n", + " } catch (error) {\n", + " console.error(\"Hubo un error con la API de Google Books:\", error);\n", + " return [];\n", + " }\n", + "}\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "2c41fa30", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Promise { \u001b[36m\u001b[39m }" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"EX2LNkSqViUC\",\n", + " \"etag\": \"kcJzqQBaPHY\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/EX2LNkSqViUC\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"CUDA Programming\",\n", + " \"subtitle\": \"A Developer's Guide to Parallel Computing with GPUs\",\n", + " \"authors\": [\n", + " \"Shane Cook\"\n", + " ],\n", + " \"publisher\": \"Newnes\",\n", + " \"publishedDate\": \"2012-12-28\",\n", + " \"description\": \"If you need to learn CUDA but don't have experience with parallel computing, CUDA Programming: A Developer's Introduction offers a detailed guide to CUDA with a grounding in parallel fundamentals. It starts by introducing CUDA and bringing you up to speed on GPU parallelism and hardware, then delving into CUDA installation. Chapters on core concepts including threads, blocks, grids, and memory focus on both parallel and CUDA-specific issues. Later, the book demonstrates CUDA in practice for optimizing applications, adjusting to new hardware, and solving common problems. - Comprehensive introduction to parallel programming with CUDA, for readers new to both - Detailed instructions help readers optimize the CUDA software development kit - Practical techniques illustrate working with memory, threads, algorithms, resources, and more - Covers CUDA on multiple hardware platforms: Mac, Linux and Windows with several NVIDIA chipsets - Each chapter includes exercises to test reader knowledge\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9780124159884\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"0124159885\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": true,\n", + " \"image\": true\n", + " },\n", + " \"pageCount\": 591,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Computers\"\n", + " ],\n", + " \"averageRating\": 1,\n", + " \"ratingsCount\": 1,\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": true,\n", + " \"contentVersion\": \"1.5.5.0.preview.3\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=EX2LNkSqViUC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=EX2LNkSqViUC&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=EX2LNkSqViUC&printsec=frontcover&dq=CUDA+Programming&hl=&cd=1&source=gbs_api\",\n", + " \"infoLink\": \"https://play.google.com/store/books/details?id=EX2LNkSqViUC&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://play.google.com/store/books/details?id=EX2LNkSqViUC\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"FOR_SALE\",\n", + " \"isEbook\": true,\n", + " \"listPrice\": {\n", + " \"amount\": 664,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amount\": 664,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"buyLink\": \"https://play.google.com/store/books/details?id=EX2LNkSqViUC&rdid=book-EX2LNkSqViUC&rdot=1&source=gbs_api\",\n", + " \"offers\": [\n", + " {\n", + " \"finskyOfferType\": 1,\n", + " \"listPrice\": {\n", + " \"amountInMicros\": 664000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amountInMicros\": 664000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"giftable\": true\n", + " }\n", + " ]\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"PARTIAL\",\n", + " \"embeddable\": true,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/CUDA_Programming-sample-epub.acsm?id=EX2LNkSqViUC&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/CUDA_Programming-sample-pdf.acsm?id=EX2LNkSqViUC&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=EX2LNkSqViUC&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"SAMPLE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"Later, the book demonstrates CUDA in practice for optimizing applications, adjusting to new hardware, and solving common problems.\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"BkAyEAAAQBAJ\",\n", + " \"etag\": \"AbjfVVyvwFE\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/BkAyEAAAQBAJ\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"Multicore and GPU Programming\",\n", + " \"subtitle\": \"An Integrated Approach\",\n", + " \"authors\": [\n", + " \"Gerassimos Barlas\"\n", + " ],\n", + " \"publisher\": \"Morgan Kaufmann\",\n", + " \"publishedDate\": \"2022-02-09\",\n", + " \"description\": \"Multicore and GPU Programming: An Integrated Approach, Second Edition offers broad coverage of key parallel computing tools, essential for multi-core CPU programming and many-core \\\"massively parallel\\\" computing. Using threads, OpenMP, MPI, CUDA and other state-of-the-art tools, the book teaches the design and development of software capable of taking advantage of modern computing platforms that incorporate CPUs, GPUs and other accelerators. Presenting material refined over more than two decades of teaching parallel computing, author Gerassimos Barlas minimizes the challenge of transitioning from sequential programming to mastering parallel platforms with multiple examples, extensive case studies, and full source code. By using this book, readers will better understand how to develop programs that run over distributed memory machines using MPI, create multi-threaded applications with either libraries or directives, write optimized applications that balance the workload between available computing resources, and profile and debug programs targeting parallel machines. - Includes comprehensive coverage of all major multi-core and many-core programming tools and platforms, including threads, OpenMP, MPI, CUDA, OpenCL and Thrust - Covers the most recent versions of the above at the time of publication - Demonstrates parallel programming design patterns and examples of how different tools and paradigms can be integrated for superior performance - Updates in the second edition include the use of the C++17 standard for all sample code, a new chapter on concurrent data structures, a new chapter on OpenCL, and the latest research on load balancing - Includes downloadable source code, examples and instructor support materials on the book's companion website\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9780128141212\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"0128141212\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": true,\n", + " \"image\": true\n", + " },\n", + " \"pageCount\": 1026,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Computers\"\n", + " ],\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": false,\n", + " \"contentVersion\": \"2.5.5.0.preview.3\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=BkAyEAAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=BkAyEAAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=BkAyEAAAQBAJ&pg=PA392&dq=CUDA+Programming&hl=&cd=2&source=gbs_api\",\n", + " \"infoLink\": \"https://play.google.com/store/books/details?id=BkAyEAAAQBAJ&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://play.google.com/store/books/details?id=BkAyEAAAQBAJ\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"FOR_SALE\",\n", + " \"isEbook\": true,\n", + " \"listPrice\": {\n", + " \"amount\": 1170,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amount\": 1170,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"buyLink\": \"https://play.google.com/store/books/details?id=BkAyEAAAQBAJ&rdid=book-BkAyEAAAQBAJ&rdot=1&source=gbs_api\",\n", + " \"offers\": [\n", + " {\n", + " \"finskyOfferType\": 1,\n", + " \"listPrice\": {\n", + " \"amountInMicros\": 1170000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amountInMicros\": 1170000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"giftable\": true\n", + " }\n", + " ]\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"PARTIAL\",\n", + " \"embeddable\": true,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Multicore_and_GPU_Programming-sample-epub.acsm?id=BkAyEAAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Multicore_and_GPU_Programming-sample-pdf.acsm?id=BkAyEAAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=BkAyEAAAQBAJ&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"SAMPLE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"... programming. Since the OpenMP 4.0 specification published in 2013, it can also target GPUs. OpenMP is covered in Chapter 8. • OpenACC: An open ... GPU programming: CUDA 6.2 CUDA's programming model: threads, blocks, and grids.\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"hI14CgAAQBAJ\",\n", + " \"etag\": \"fI7TnUzZENs\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/hI14CgAAQBAJ\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"GPU Programming in MATLAB\",\n", + " \"authors\": [\n", + " \"Nikolaos Ploskas\",\n", + " \"Nikolaos Samaras\"\n", + " ],\n", + " \"publisher\": \"Morgan Kaufmann\",\n", + " \"publishedDate\": \"2016-08-25\",\n", + " \"description\": \"GPU programming in MATLAB is intended for scientists, engineers, or students who develop or maintain applications in MATLAB and would like to accelerate their codes using GPU programming without losing the many benefits of MATLAB. The book starts with coverage of the Parallel Computing Toolbox and other MATLAB toolboxes for GPU computing, which allow applications to be ported straightforwardly onto GPUs without extensive knowledge of GPU programming. The next part covers built-in, GPU-enabled features of MATLAB, including options to leverage GPUs across multicore or different computer systems. Finally, advanced material includes CUDA code in MATLAB and optimizing existing GPU applications. Throughout the book, examples and source codes illustrate every concept so that readers can immediately apply them to their own development. - Provides in-depth, comprehensive coverage of GPUs with MATLAB, including the parallel computing toolbox and built-in features for other MATLAB toolboxes - Explains how to accelerate computationally heavy applications in MATLAB without the need to re-write them in another language - Presents case studies illustrating key concepts across multiple fields - Includes source code, sample datasets, and lecture slides\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9780128051337\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"0128051337\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": true,\n", + " \"image\": true\n", + " },\n", + " \"pageCount\": 320,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Computers\"\n", + " ],\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": false,\n", + " \"contentVersion\": \"1.3.3.0.preview.3\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=hI14CgAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=hI14CgAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=hI14CgAAQBAJ&pg=PA199&dq=CUDA+Programming&hl=&cd=3&source=gbs_api\",\n", + " \"infoLink\": \"https://play.google.com/store/books/details?id=hI14CgAAQBAJ&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://play.google.com/store/books/details?id=hI14CgAAQBAJ\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"FOR_SALE\",\n", + " \"isEbook\": true,\n", + " \"listPrice\": {\n", + " \"amount\": 797,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amount\": 797,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"buyLink\": \"https://play.google.com/store/books/details?id=hI14CgAAQBAJ&rdid=book-hI14CgAAQBAJ&rdot=1&source=gbs_api\",\n", + " \"offers\": [\n", + " {\n", + " \"finskyOfferType\": 1,\n", + " \"listPrice\": {\n", + " \"amountInMicros\": 797000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amountInMicros\": 797000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"giftable\": true\n", + " }\n", + " ]\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"PARTIAL\",\n", + " \"embeddable\": true,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/GPU_Programming_in_MATLAB-sample-epub.acsm?id=hI14CgAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/GPU_Programming_in_MATLAB-sample-pdf.acsm?id=hI14CgAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=hI14CgAAQBAJ&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"SAMPLE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"Nikolaos Ploskas, Nikolaos Samaras. Run. CUDA. or. PTX. code. CHAPTER. 7. CHAPTER. OBJECTIVES. This Chapter explains how to create an executable kernel for a CUDA C code or PTX code and run that kernel on a GPU by calling it through MATLAB ...\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"3b63x-0P3_UC\",\n", + " \"etag\": \"ifkwaiKEUq0\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/3b63x-0P3_UC\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"Computer Organization and Design\",\n", + " \"subtitle\": \"The Hardware/Software Interface\",\n", + " \"authors\": [\n", + " \"David A. Patterson\",\n", + " \"John L. Hennessy\"\n", + " ],\n", + " \"publisher\": \"Morgan Kaufmann\",\n", + " \"publishedDate\": \"2008-11-17\",\n", + " \"description\": \"Computer Organization and Design, Fourth Edition, provides a new focus on the revolutionary change taking place in industry today: the switch from uniprocessor to multicore microprocessors. This new emphasis on parallelism is supported by updates reflecting the newest technologies with examples highlighting the latest processor designs, benchmarking standards, languages and tools. As with previous editions, a MIPS processor is the core used to present the fundamentals of hardware technologies, assembly language, computer arithmetic, pipelining, memory hierarchies and I/O. Along with its increased coverage of parallelism, this new edition offers new content on Flash memory and virtual machines as well as a new and important appendix written by industry experts covering the emergence and importance of the modern GPU (graphics processing unit), the highly parallel, highly multithreaded multiprocessor optimized for visual computing. This book contains a new exercise paradigm that allows instructors to reconfigure the 600 exercises included in the book to generate new exercises and solutions of their own. The companion CD provides a toolkit of simulators and compilers along with tutorials for using them as well as advanced content for further study and a search utility for finding content on the CD and in the printed text. This text is designed for professional digital system designers, programmers, application developers, and system software developers as well as undergraduate students in Computer Science, Computer Engineering and Electrical Engineering courses in Computer Organization, Computer Design. A new exercise paradigm allows instructors to reconfigure the 600 exercises included in the book to easily generate new exercises and solutions of their own. The companion CD provides a toolkit of simulators and compilers along with tutorials for using them, as well as advanced content for further study and a search utility for finding content on the CD and in the printed text. For the convenience of readers who have purchased an ebook edition or who may have misplaced the CD-ROM, all CD content is available as a download at http://bit.ly/12XinUx.\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9780080922812\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"0080922813\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": false,\n", + " \"image\": true\n", + " },\n", + " \"pageCount\": 913,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Computers\"\n", + " ],\n", + " \"averageRating\": 3.5,\n", + " \"ratingsCount\": 4,\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": true,\n", + " \"contentVersion\": \"2.3.1.0.preview.1\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=3b63x-0P3_UC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=3b63x-0P3_UC&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=3b63x-0P3_UC&pg=SL1-PA17&dq=CUDA+Programming&hl=&cd=4&source=gbs_api\",\n", + " \"infoLink\": \"https://play.google.com/store/books/details?id=3b63x-0P3_UC&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://play.google.com/store/books/details?id=3b63x-0P3_UC\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"FOR_SALE\",\n", + " \"isEbook\": true,\n", + " \"listPrice\": {\n", + " \"amount\": 1196,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amount\": 1196,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"buyLink\": \"https://play.google.com/store/books/details?id=3b63x-0P3_UC&rdid=book-3b63x-0P3_UC&rdot=1&source=gbs_api\",\n", + " \"offers\": [\n", + " {\n", + " \"finskyOfferType\": 1,\n", + " \"listPrice\": {\n", + " \"amountInMicros\": 1196000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amountInMicros\": 1196000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"giftable\": true\n", + " }\n", + " ]\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"PARTIAL\",\n", + " \"embeddable\": true,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": false\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Computer_Organization_and_Design-sample-pdf.acsm?id=3b63x-0P3_UC&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=3b63x-0P3_UC&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"SAMPLE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"... CUDA programming model has provided a far easier way to exploit the scalable high-performance floating-point and memory bandwidth of GPUs with the C programming language. Programming Parallel Computing Applications CUDA, Brook, and CAL ...\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"PHS1wwEACAAJ\",\n", + " \"etag\": \"yG89cKoGtVk\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/PHS1wwEACAAJ\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"Hands-On GPU Programming with CUDA\",\n", + " \"authors\": [\n", + " \"Jaegeun Han\",\n", + " \"Bharatkumar Sharma\"\n", + " ],\n", + " \"publishedDate\": \"2019-09-27\",\n", + " \"description\": \"Explore different GPU programming methods using libraries and directives, such as OpenACC, with extension to languages such as C, C++, and Python Key Features Learn parallel programming principles and practices and performance analysis in GPU computing Get to grips with distributed multi GPU programming and other approaches to GPU programming Understand how GPU acceleration in deep learning models can improve their performance Book Description Compute Unified Device Architecture (CUDA) is NVIDIA's GPU computing platform and application programming interface. It's designed to work with programming languages such as C, C++, and Python. With CUDA, you can leverage a GPU's parallel computing power for a range of high-performance computing applications in the fields of science, healthcare, and deep learning. Learn CUDA Programming will help you learn GPU parallel programming and understand its modern applications. In this book, you'll discover CUDA programming approaches for modern GPU architectures. You'll not only be guided through GPU features, tools, and APIs, you'll also learn how to analyze performance with sample parallel programming algorithms. This book will help you optimize the performance of your apps by giving insights into CUDA programming platforms with various libraries, compiler directives (OpenACC), and other languages. As you progress, you'll learn how additional computing power can be generated using multiple GPUs in a box or in multiple boxes. Finally, you'll explore how CUDA accelerates deep learning algorithms, including convolutional neural networks (CNNs) and recurrent neural networks (RNNs). By the end of this CUDA book, you'll be equipped with the skills you need to integrate the power of GPU computing in your applications. What you will learn Understand general GPU operations and programming patterns in CUDA Uncover the difference between GPU programming and CPU programming Analyze GPU application performance and implement optimization strategies Explore GPU programming, profiling, and debugging tools Grasp parallel programming algorithms and how to implement them Scale GPU-accelerated applications with multi-GPU and multi-nodes Delve into GPU programming platforms with accelerated libraries, Python, and OpenACC Gain insights into deep learning accelerators in CNNs and RNNs using GPUs Who this book is for This beginner-level book is for programmers who want to delve into parallel computing, become part of the high-performance computing community and build modern applications. Basic C and C++ programming experience is assumed. For deep learning enthusiasts, this book covers Python InterOps, DL libraries, and practical examples on performance estimation.\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"1788996240\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9781788996242\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": false,\n", + " \"image\": false\n", + " },\n", + " \"pageCount\": 508,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Computers\"\n", + " ],\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": false,\n", + " \"contentVersion\": \"preview-1.0.0\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=PHS1wwEACAAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=PHS1wwEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=PHS1wwEACAAJ&dq=CUDA+Programming&hl=&cd=5&source=gbs_api\",\n", + " \"infoLink\": \"http://books.google.com.mx/books?id=PHS1wwEACAAJ&dq=CUDA+Programming&hl=&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://books.google.com/books/about/Hands_On_GPU_Programming_with_CUDA.html?hl=&id=PHS1wwEACAAJ\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"NOT_FOR_SALE\",\n", + " \"isEbook\": false\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"NO_PAGES\",\n", + " \"embeddable\": false,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": false\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": false\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=PHS1wwEACAAJ&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"NONE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"Learn CUDA Programming will help you learn GPU parallel programming and understand its modern applications. In this book, you'll discover CUDA programming approaches for modern GPU architectures.\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"WWMNAAAAQBAJ\",\n", + " \"etag\": \"JP4kveLFAu8\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/WWMNAAAAQBAJ\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"Proceedings of 2013 Chinese Intelligent Automation Conference\",\n", + " \"subtitle\": \"Intelligent Automation & Intelligent Technology and Systems\",\n", + " \"authors\": [\n", + " \"Zengqi Sun\",\n", + " \"Zhidong Deng\"\n", + " ],\n", + " \"publisher\": \"Springer Science & Business Media\",\n", + " \"publishedDate\": \"2013-07-10\",\n", + " \"description\": \"Proceedings of the 2013 Chinese Intelligent Automation Conference presents selected research papers from the CIAC’13, held in Yangzhou, China. The topics include e.g. adaptive control, fuzzy control, neural network based control, knowledge based control, hybrid intelligent control, learning control, evolutionary mechanism based control, multi-sensor integration, failure diagnosis, and reconfigurable control. Engineers and researchers from academia, industry, and government can gain an inside view of new solutions combining ideas from multiple disciplines in the field of intelligent automation. Zengqi Sun and Zhidong Deng are professors at the Department of Computer Science, Tsinghua University, China.\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9783642384608\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"3642384609\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": true,\n", + " \"image\": true\n", + " },\n", + " \"pageCount\": 840,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Technology & Engineering\"\n", + " ],\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": false,\n", + " \"contentVersion\": \"1.12.10.0.preview.3\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=WWMNAAAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=WWMNAAAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=WWMNAAAAQBAJ&pg=PA253&dq=CUDA+Programming&hl=&cd=6&source=gbs_api\",\n", + " \"infoLink\": \"https://play.google.com/store/books/details?id=WWMNAAAAQBAJ&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://play.google.com/store/books/details?id=WWMNAAAAQBAJ\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"FOR_SALE\",\n", + " \"isEbook\": true,\n", + " \"listPrice\": {\n", + " \"amount\": 4229.91,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amount\": 4229.91,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"buyLink\": \"https://play.google.com/store/books/details?id=WWMNAAAAQBAJ&rdid=book-WWMNAAAAQBAJ&rdot=1&source=gbs_api\",\n", + " \"offers\": [\n", + " {\n", + " \"finskyOfferType\": 1,\n", + " \"listPrice\": {\n", + " \"amountInMicros\": 4229910000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amountInMicros\": 4229910000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"giftable\": true\n", + " }\n", + " ]\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"PARTIAL\",\n", + " \"embeddable\": true,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Proceedings_of_2013_Chinese_Intelligent-sample-epub.acsm?id=WWMNAAAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Proceedings_of_2013_Chinese_Intelligent-sample-pdf.acsm?id=WWMNAAAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=WWMNAAAAQBAJ&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"SAMPLE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"... CUDA Main Memory CPU • Copy data • Copy result Memory for GPU • Instruct the processing • GPU:Execute parallel in each core code that runs on the GPU (usually ... CUDA Programming in Mathematica 28.4...CUDA Programming in MATLAB.\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"Jgx_BAAAQBAJ\",\n", + " \"etag\": \"dKKhYwaCZOs\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/Jgx_BAAAQBAJ\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"Professional CUDA C Programming\",\n", + " \"authors\": [\n", + " \"John Cheng\",\n", + " \"Max Grossman\",\n", + " \"Ty McKercher\"\n", + " ],\n", + " \"publisher\": \"John Wiley & Sons\",\n", + " \"publishedDate\": \"2014-09-08\",\n", + " \"description\": \"Break into the powerful world of parallel GPU programming with this down-to-earth, practical guide Designed for professionals across multiple industrial sectors, Professional CUDA C Programming presents CUDA -- a parallel computing platform and programming model designed to ease the development of GPU programming -- fundamentals in an easy-to-follow format, and teaches readers how to think in parallel and implement parallel algorithms on GPUs. Each chapter covers a specific topic, and includes workable examples that demonstrate the development process, allowing readers to explore both the \\\"hard\\\" and \\\"soft\\\" aspects of GPU programming. Computing architectures are experiencing a fundamental shift toward scalable parallel computing motivated by application requirements in industry and science. This book demonstrates the challenges of efficiently utilizing compute resources at peak performance, presents modern techniques for tackling these challenges, while increasing accessibility for professionals who are not necessarily parallel programming experts. The CUDA programming model and tools empower developers to write high-performance applications on a scalable, parallel computing platform: the GPU. However, CUDA itself can be difficult to learn without extensive programming experience. Recognized CUDA authorities John Cheng, Max Grossman, and Ty McKercher guide readers through essential GPU programming skills and best practices in Professional CUDA C Programming, including: CUDA Programming Model GPU Execution Model GPU Memory model Streams, Event and Concurrency Multi-GPU Programming CUDA Domain-Specific Libraries Profiling and Performance Tuning The book makes complex CUDA concepts easy to understand for anyone with knowledge of basic software development with exercises designed to be both readable and high-performance. For the professional seeking entrance to parallel computing and the high-performance computing community, Professional CUDA C Programming is an invaluable resource, with the most current information available on the market.\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9781118739310\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"1118739310\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": true,\n", + " \"image\": true\n", + " },\n", + " \"pageCount\": 528,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Computers\"\n", + " ],\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": true,\n", + " \"contentVersion\": \"1.14.9.0.preview.3\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=Jgx_BAAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=Jgx_BAAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=Jgx_BAAAQBAJ&printsec=frontcover&dq=CUDA+Programming&hl=&cd=7&source=gbs_api\",\n", + " \"infoLink\": \"https://play.google.com/store/books/details?id=Jgx_BAAAQBAJ&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://play.google.com/store/books/details?id=Jgx_BAAAQBAJ\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"FOR_SALE\",\n", + " \"isEbook\": true,\n", + " \"listPrice\": {\n", + " \"amount\": 639,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amount\": 639,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"buyLink\": \"https://play.google.com/store/books/details?id=Jgx_BAAAQBAJ&rdid=book-Jgx_BAAAQBAJ&rdot=1&source=gbs_api\",\n", + " \"offers\": [\n", + " {\n", + " \"finskyOfferType\": 1,\n", + " \"listPrice\": {\n", + " \"amountInMicros\": 639000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amountInMicros\": 639000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"giftable\": true\n", + " }\n", + " ]\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"PARTIAL\",\n", + " \"embeddable\": true,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Professional_CUDA_C_Programming-sample-epub.acsm?id=Jgx_BAAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Professional_CUDA_C_Programming-sample-pdf.acsm?id=Jgx_BAAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=Jgx_BAAAQBAJ&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"SAMPLE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"Professional CUDA C Programming: Focuses on GPU programming skills and best practices that deliver outstanding performance Shows you how to think in parallel Turns complex subjects into easy-to-understand concepts Makes information ...\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"c-64EQAAQBAJ\",\n", + " \"etag\": \"lLJcWGr0Bhc\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/c-64EQAAQBAJ\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"Learning CUDA Programming with Modern C++\",\n", + " \"subtitle\": \"A Hands-On Guide to Building High-Performance, GPU-Accelerated Applications\",\n", + " \"authors\": [\n", + " \"CORWAN MARR\"\n", + " ],\n", + " \"publisher\": \"Oladosun Mopelola Opeyemi\",\n", + " \"publishedDate\": \"2026-01-28\",\n", + " \"description\": \"Are you ready to harness the full power of your computer’s graphics card? Do you want to accelerate your applications and enhance your programming skills with GPU computing? In \\\"Learning CUDA Programming with Modern C++,\\\" you’ll learn how to leverage the power of NVIDIA GPUs to create high-performance, GPU-accelerated applications. Whether you’re a C++ developer, a beginner programmer, or someone looking to boost your skills, this book provides a clear, practical guide to writing efficient GPU code. What you’ll learn: l Hands-on techniques: Build real-world projects that teach you how to write and optimize CUDA code for modern GPUs. l Understand CUDA programming: Learn about GPU architecture, memory management, and how to organize threads efficiently with Modern C++. l Maximize performance: Gain insight into profiling, debugging, and optimizing code for faster execution. l Complete projects: From image processing pipelines to Monte Carlo simulations, the projects in this book help you apply what you’ve learned in practical ways. This book is designed to help you write powerful, maintainable code that runs on GPUs, offering you the skills needed to tackle complex problems and build applications that perform at scale. Don’t just read about high-performance programming — start writing your own GPU-accelerated applications today. Buy your copy now and begin mastering CUDA programming!\",\n", + " \"readingModes\": {\n", + " \"text\": true,\n", + " \"image\": true\n", + " },\n", + " \"pageCount\": 244,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Computers\"\n", + " ],\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": false,\n", + " \"contentVersion\": \"2.3.3.0.preview.3\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=c-64EQAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=c-64EQAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=c-64EQAAQBAJ&printsec=frontcover&dq=CUDA+Programming&hl=&cd=8&source=gbs_api\",\n", + " \"infoLink\": \"https://play.google.com/store/books/details?id=c-64EQAAQBAJ&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://play.google.com/store/books/details?id=c-64EQAAQBAJ\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"FOR_SALE\",\n", + " \"isEbook\": true,\n", + " \"listPrice\": {\n", + " \"amount\": 109,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amount\": 109,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"buyLink\": \"https://play.google.com/store/books/details?id=c-64EQAAQBAJ&rdid=book-c-64EQAAQBAJ&rdot=1&source=gbs_api\",\n", + " \"offers\": [\n", + " {\n", + " \"finskyOfferType\": 1,\n", + " \"listPrice\": {\n", + " \"amountInMicros\": 109000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amountInMicros\": 109000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"giftable\": true\n", + " }\n", + " ]\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"PARTIAL\",\n", + " \"embeddable\": true,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Learning_CUDA_Programming_with_Modern_C+-sample-epub.acsm?id=c-64EQAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true,\n", + " \"acsTokenLink\": \"http://books.google.com.mx/books/download/Learning_CUDA_Programming_with_Modern_C+-sample-pdf.acsm?id=c-64EQAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=c-64EQAAQBAJ&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"SAMPLE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"This book is designed to help you write powerful, maintainable code that runs on GPUs, offering you the skills needed to tackle complex problems and build applications that perform at scale.\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"KUxsAQAAQBAJ\",\n", + " \"etag\": \"q7yxPpMdjjk\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/KUxsAQAAQBAJ\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"The CUDA Handbook\",\n", + " \"subtitle\": \"A Comprehensive Guide to GPU Programming\",\n", + " \"authors\": [\n", + " \"Nicholas Wilt\"\n", + " ],\n", + " \"publisher\": \"Pearson Education\",\n", + " \"publishedDate\": \"2013\",\n", + " \"description\": \"'The CUDA Handbook' begins where 'CUDA by Example' leaves off, discussing both CUDA hardware and software in detail that will engage any CUDA developer, from the casual to the most hardcore. Newer CUDA developers will see how the hardware processes commands and the driver checks progress; hardcore CUDA developers will appreciate topics such as the driver API, context migration, and how best to structure CPU/GPU data interchange and synchronization. The book is partly a reference resource and partly a cookbook.\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9780321809469\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"0321809467\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": false,\n", + " \"image\": false\n", + " },\n", + " \"pageCount\": 526,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Computers\"\n", + " ],\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": false,\n", + " \"contentVersion\": \"0.2.2.0.preview.0\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=KUxsAQAAQBAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=KUxsAQAAQBAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=KUxsAQAAQBAJ&dq=CUDA+Programming&hl=&cd=9&source=gbs_api\",\n", + " \"infoLink\": \"http://books.google.com.mx/books?id=KUxsAQAAQBAJ&dq=CUDA+Programming&hl=&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://books.google.com/books/about/The_CUDA_Handbook.html?hl=&id=KUxsAQAAQBAJ\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"NOT_FOR_SALE\",\n", + " \"isEbook\": false\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"NO_PAGES\",\n", + " \"embeddable\": false,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": false\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=KUxsAQAAQBAJ&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"NONE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"'The CUDA Handbook' begins where 'CUDA by Example' leaves off, discussing both CUDA hardware and software in detail that will engage any CUDA developer, from the casual to the most hardcore.\"\n", + " }\n", + " },\n", + " {\n", + " \"kind\": \"books#volume\",\n", + " \"id\": \"l_q1DwAAQBAJ\",\n", + " \"etag\": \"JWah0WcJAEc\",\n", + " \"selfLink\": \"https://www.googleapis.com/books/v1/volumes/l_q1DwAAQBAJ\",\n", + " \"volumeInfo\": {\n", + " \"title\": \"Information, Communication and Engineering\",\n", + " \"authors\": [\n", + " \"Teen Hang Meen\"\n", + " ],\n", + " \"publisher\": \"Trans Tech Publications Ltd\",\n", + " \"publishedDate\": \"2013-02-27\",\n", + " \"description\": \"Selected, peer reviewed papers from the 2012 International Conference on Information, Communication and Engineering (ICICE 2012), December 15-20, 2012, Fuzhou, Taiwan\",\n", + " \"industryIdentifiers\": [\n", + " {\n", + " \"type\": \"ISBN_13\",\n", + " \"identifier\": \"9783038260530\"\n", + " },\n", + " {\n", + " \"type\": \"ISBN_10\",\n", + " \"identifier\": \"3038260533\"\n", + " }\n", + " ],\n", + " \"readingModes\": {\n", + " \"text\": false,\n", + " \"image\": true\n", + " },\n", + " \"pageCount\": 563,\n", + " \"printType\": \"BOOK\",\n", + " \"categories\": [\n", + " \"Technology & Engineering\"\n", + " ],\n", + " \"maturityRating\": \"NOT_MATURE\",\n", + " \"allowAnonLogging\": false,\n", + " \"contentVersion\": \"0.1.2.0.preview.1\",\n", + " \"panelizationSummary\": {\n", + " \"containsEpubBubbles\": false,\n", + " \"containsImageBubbles\": false\n", + " },\n", + " \"imageLinks\": {\n", + " \"smallThumbnail\": \"http://books.google.com/books/content?id=l_q1DwAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " \"thumbnail\": \"http://books.google.com/books/content?id=l_q1DwAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " \"language\": \"en\",\n", + " \"previewLink\": \"http://books.google.com.mx/books?id=l_q1DwAAQBAJ&pg=PA15&dq=CUDA+Programming&hl=&cd=10&source=gbs_api\",\n", + " \"infoLink\": \"https://play.google.com/store/books/details?id=l_q1DwAAQBAJ&source=gbs_api\",\n", + " \"canonicalVolumeLink\": \"https://play.google.com/store/books/details?id=l_q1DwAAQBAJ\"\n", + " },\n", + " \"saleInfo\": {\n", + " \"country\": \"MX\",\n", + " \"saleability\": \"FOR_SALE\",\n", + " \"isEbook\": true,\n", + " \"listPrice\": {\n", + " \"amount\": 5299,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amount\": 5299,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"buyLink\": \"https://play.google.com/store/books/details?id=l_q1DwAAQBAJ&rdid=book-l_q1DwAAQBAJ&rdot=1&source=gbs_api\",\n", + " \"offers\": [\n", + " {\n", + " \"finskyOfferType\": 1,\n", + " \"listPrice\": {\n", + " \"amountInMicros\": 5299000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"retailPrice\": {\n", + " \"amountInMicros\": 5299000000,\n", + " \"currencyCode\": \"MXN\"\n", + " },\n", + " \"giftable\": true\n", + " }\n", + " ]\n", + " },\n", + " \"accessInfo\": {\n", + " \"country\": \"MX\",\n", + " \"viewability\": \"PARTIAL\",\n", + " \"embeddable\": true,\n", + " \"publicDomain\": false,\n", + " \"textToSpeechPermission\": \"ALLOWED\",\n", + " \"epub\": {\n", + " \"isAvailable\": false\n", + " },\n", + " \"pdf\": {\n", + " \"isAvailable\": true\n", + " },\n", + " \"webReaderLink\": \"http://play.google.com/books/reader?id=l_q1DwAAQBAJ&hl=&source=gbs_api\",\n", + " \"accessViewStatus\": \"SAMPLE\",\n", + " \"quoteSharingAllowed\": false\n", + " },\n", + " \"searchInfo\": {\n", + " \"textSnippet\": \"... program GPU as a graphics device, the CUDA of NIVDIA and the OpenCL provide more general programming environment for users. By supporting memory access model, interfaces to access GPUs directly and programming toolkits, users can ...\"\n", + " }\n", + " }\n", + "]\n" + ] + } + ], + "source": [ + "// Ejemplo de uso:\n", + "buscarBibliografia(\"CUDA Programming\")\n", + " .then((libros) => console.log(JSON.stringify(libros, null, 2)));\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "09b2afa8", + "metadata": {}, + "outputs": [], + "source": [ + "// Si no lo instalaste en el deno.json, usa import CSL from 'npm:citeproc';\n", + "import CSL from \"citeproc\";\n", + "\n", + "// 1. Definición de Tipos de Entrada y Salida\n", + "export type FormatoCita = \"apa\" | \"ieee\" | \"vancouver\" | \"chicago\";\n", + "\n", + "export interface ParametrosBusqueda {\n", + " query: string;\n", + " maxResults?: number;\n", + " formato: FormatoCita;\n", + "}\n", + "\n", + "// Tipos requeridos por Citeproc-js (CSL-JSON)\n", + "interface CSLAuthor {\n", + " family: string;\n", + " given: string;\n", + "}\n", + "\n", + "interface CSLItem {\n", + " id: string;\n", + " type: \"book\";\n", + " title: string;\n", + " author: CSLAuthor[];\n", + " publisher?: string;\n", + " issued?: { \"date-parts\": number[][] };\n", + " ISBN?: string;\n", + "}\n", + "\n", + "// 2. Funciones Auxiliares\n", + "function parsearAutor(nombreCompleto: string): CSLAuthor {\n", + " if (nombreCompleto.includes(\",\")) {\n", + " return {\n", + " family: nombreCompleto.split(\",\")[0].trim(),\n", + " given: nombreCompleto.split(\",\")[1].trim(),\n", + " };\n", + " }\n", + " const partes = nombreCompleto.trim().split(\" \");\n", + " if (partes.length === 1) return { family: partes[0], given: \"\" };\n", + " const family = partes.pop() || \"\";\n", + " const given = partes.join(\" \");\n", + " return { family, given };\n", + "}\n", + "\n", + "// Función asíncrona para leer los archivos locales en Deno\n", + "async function obtenerArchivoXML(tipo: string): Promise {\n", + " // Mapeo exacto a los nombres de los archivos que subiste\n", + " const archivos: Record = {\n", + " \"apa\": \"./apa.csl\",\n", + " \"ieee\": \"./ieee.csl\",\n", + " \"chicago\": \"./chicago-author-date.csl\",\n", + " \"vancouver\": \"./nlm-citation-sequence.csl\",\n", + " \"es-MX\": \"./locales-es-MX.xml\",\n", + " };\n", + "\n", + " const ruta = archivos[tipo];\n", + " if (!ruta) throw new Error(`No hay archivo configurado para: ${tipo}`);\n", + "\n", + " return await Deno.readTextFile(ruta);\n", + "}\n", + "\n", + "// 3. Función Principal\n", + "export async function obtenerYFormatearBibliografia(\n", + " params: ParametrosBusqueda,\n", + "): Promise {\n", + " const { query, maxResults = 5, formato } = params;\n", + "\n", + " console.log(\n", + " Deno.env.get(\"GOOGLE_API_KEY\")\n", + " ? \"Clave de API encontrada\"\n", + " : \"No se encontró la clave de API\",\n", + " );\n", + " // A. Obtener datos de Google Books\n", + " const url = `https://www.googleapis.com/books/v1/volumes?q=${\n", + " encodeURIComponent(query)\n", + " }&maxResults=${maxResults}&key=${Deno.env.get(\"GOOGLE_API_KEY\")}`;\n", + " const response = await fetch(url);\n", + "\n", + " if (!response.ok) throw new Error(`Error en la API: ${response.status}`);\n", + " const data = await response.json();\n", + " if (!data.items || data.items.length === 0) return [];\n", + "\n", + " // B. Transformar a CSL-JSON\n", + " const cslItems: Record = {};\n", + "\n", + " data.items.forEach((item: any) => {\n", + " const info = item.volumeInfo;\n", + " const id = item.id;\n", + "\n", + " cslItems[id] = {\n", + " id,\n", + " type: \"book\",\n", + " title: info.title || \"Sin título\",\n", + " author: (info.authors || []).map(parsearAutor),\n", + " publisher: info.publisher,\n", + " // Citeproc espera el año en una matriz bidimensional\n", + " issued: info.publishedDate\n", + " ? { \"date-parts\": [[parseInt(info.publishedDate.substring(0, 4), 10)]] }\n", + " : undefined,\n", + " ISBN: info.industryIdentifiers?.[0]?.identifier,\n", + " };\n", + " });\n", + " console.log();\n", + "\n", + " // C. Configurar Citeproc-js (Ahora con await para leer los archivos locales)\n", + " const xmlEstilo = await obtenerArchivoXML(formato);\n", + " const xmlIdioma = await obtenerArchivoXML(\"es-MX\");\n", + "\n", + " const sys = {\n", + " // Al pedir un idioma, siempre devolvemos nuestro XML de México\n", + " retrieveLocale: (lang: string) => xmlIdioma,\n", + " retrieveItem: (id: string) => cslItems[id],\n", + " };\n", + "\n", + " const engine = new CSL.Engine(sys, xmlEstilo);\n", + " engine.updateItems(Object.keys(cslItems));\n", + "\n", + " // D. Generar Bibliografía\n", + " const resultado = engine.makeBibliography();\n", + "\n", + " // makeBibliography() retorna [metadata, [array de strings formateados]]\n", + " if (!resultado || !resultado[1]) return [];\n", + "\n", + " // Retornamos el arreglo limpiando etiquetas HTML residuales si las hay\n", + " return resultado[1].map((cita: string) =>\n", + " cita.replace(/(<([^>]+)>)/gi, \"\").trim()\n", + " );\n", + "}\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6ecdc20f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Clave de API encontrada\n", + "\n", + "[\n", + " \"[1]A. F. R. Pérez, MF0223_3 Sistemas Operativos y Aplicaciones Informáticas. Ra-Ma Editorial, 2013.\",\n", + " \"[2]E. QUERO CATALINAS, Sistemas operativos y lenguajes de programación. Ediciones Paraninfo, S.A., 2002.\",\n", + " \"[3]J. M. M. Pascual y J. A. P.-C. Atanasio, Conceptos de sistemas operativos. Univ Pontifica Comillas, 2002.\",\n", + " \"[4]J. N. Camazón, Sistemas operativos monopuesto. Editex, 2011.\",\n", + " \"[5]M. D. P. ALEGRE RAMOS, Sistemas operativos monopuesto. Ediciones Paraninfo, S.A., 2010.\",\n", + " \"[6]B. S. Pérez, Cuaderno práctico de Windows. Sistemas Operativos Monopuestos. Ciclos Formativos de Informática. Lulu.com, 2015.\",\n", + " \"[7]A. S. Tanenbaum, Sistemas operativos modernos. Pearson Educación, 2003.\",\n", + " \"[8]J. L. Peterson y A. Silberschatz, Sistemas operativos. Reverte, 1994.\",\n", + " \"[9]J. L. R. Cabrera, Implantación de Sistemas Operativos (GRADO SUP.). Grupo Editorial RA-MA.\",\n", + " \"[10]L. R. González, MF0219_2 Instalación y Configuración de Sistemas Operativos. Ra-Ma Editorial, 2011.\"\n", + "]\n" + ] + }, + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n", + "\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n", + "\u001b[1;31mClick here for more info. \n", + "\u001b[1;31mView Jupyter log for further details." + ] + } + ], + "source": [ + "const referencias = await obtenerYFormatearBibliografia({\n", + " query: \"Sistemas Operativos\",\n", + " maxResults: 10,\n", + " formato: \"ieee\",\n", + "});\n", + "\n", + "console.log(referencias);\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41ad293a", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Deno", + "language": "typescript", + "name": "deno" + }, + "language_info": { + "codemirror_mode": "typescript", + "file_extension": ".ts", + "mimetype": "text/x.typescript", + "name": "typescript", + "nbconvert_exporter": "script", + "pygments_lexer": "typescript", + "version": "5.9.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebooks/ieee.csl b/notebooks/ieee.csl new file mode 100644 index 0000000..7612c15 --- /dev/null +++ b/notebooks/ieee.csl @@ -0,0 +1,519 @@ + + diff --git a/notebooks/locales-es-MX.xml b/notebooks/locales-es-MX.xml new file mode 100644 index 0000000..4d980a5 --- /dev/null +++ b/notebooks/locales-es-MX.xml @@ -0,0 +1,757 @@ + + + + + Juan Ignacio Flores Salgado + https://www.mendeley.com/profiles/juan-ignacio-flores-salgado/ + + This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + 2025-10-16T03:24:00+00:00 + + + + + + + + + + + + + + + consultado + advance online publication + album + y + et al. + anónimo + en + audio recording + disponible en + de + circa + citado + et al. + film + en preparación + a partir de + henceforth + ibid. + en + en imprenta + internet + carta + loc. cit. + sin fecha + no place + no publisher + on + en línea + op. cit. + obra original publicada en + comunicación personal + podcast + podcast episode + preprint + presentado en + radio broadcast + radio series + radio series episode + + referencia + referencias + + recuperado + review of + escala + special issue + special section + television broadcast + television series + television series episode + video + working paper + + + anón. + c. + s/f + n.p. + n.p. + + ref. + refs. + + rev. of + + + + + preprint + journal article + magazine article + newspaper article + bill + + broadcast + + classic + collection + dataset + document + entry + dictionary entry + encyclopedia entry + event + + graphic + hearing + entrevista + legal case + legislation + manuscript + map + video recording + musical score + pamphlet + conference paper + patent + performance + periodical + comunicación personal + post + blog post + regulation + report + review + book review + software + audio recording + presentation + standard + thesis + treaty + webpage + + + journal art. + mag. art. + newspaper art. + + + doc. + + graph. + interv. + MS + video rec. + rep. + rev. + bk. rev. + audio rec. + + + + testimony of + review of + review of the book + + + + + d. C. + a. C. + BCE + CE + + + + + + + + : + , + ; + + + a + a + o + + + primera + segunda + tercera + cuarta + quinta + sexta + séptima + octava + novena + décima + + + + act + acts + + + appendix + appendices + + + article + articles + + + libro + libros + + + canon + canons + + + capítulo + capítulos + + + columna + columnas + + + location + locations + + + equation + equations + + + figura + figuras + + + folio + folios + + + número + números + + + línea + líneas + + + nota + notas + + + opus + opera + + + página + páginas + + + párrafo + párrafos + + + parte + partes + + + rule + rules + + + scene + scenes + + + sección + secciones + + + sub voce + sub vocibus + + + supplement + supplements + + + table + tables + + + + + + + title + titles + + + verso + versos + + + volumen + volúmenes + + + + + app. + apps. + + + art. + arts. + + + lib. + libs. + + + cap. + caps. + + + col. + cols. + + + loc. + locs. + + + eq. + eqs. + + + fig. + figs. + + + f. + ff. + + + núm. + núms. + + + l. + ls. + + + n. + nn. + + + op. + opp. + + + p. + pp. + + + párr. + párrs. + + + pt. + pts. + + + r. + rr. + + + sc. + scs. + + + sec. + secs. + + + s. v. + s. vv. + + + supp. + supps. + + + tbl. + tbls. + + + + + + + tit. + tits. + + + v. + vv. + + + vol. + vols. + + + + + + + + + § + § + + + + + chapter + chapters + + + citation + citations + + + número + números + + + edición + ediciones + + + reference + references + + + number + numbers + + + página + páginas + + + volume + volumes + + + page + pages + + + printing + printings + + versión + + + + chap. + chaps. + + + cit. + cits. + + + núm. + núms. + + + ed. + eds. + + + ref. + refs. + + + no. + nos. + + + p. + pp. + + + vol. + vols. + + + p. + pp. + + + print. + prints. + + + + + + chair + chairs + + + ed. + eds. + + + compiler + compilers + + + + + contributor + contributors + + + curator + curators + + + director + directores + + + editor + editores + + + editor y traductor + editores y traductores + + + editor y traductor + editores y traductores + + + coordinador + coordinadores + + + executive producer + executive producers + + + guest + guests + + + host + hosts + + + ilustrador + ilustradores + + + + narrator + narrators + + + organizer + organizers + + + + performer + performers + + + producer + producers + + + + + writer + writers + + + series creator + series creators + + + traductor + traductores + + + + + comp. + comps. + + + contrib. + contribs. + + + cur. + curs. + + + dir. + dirs. + + + ed. + eds. + + + ed. y trad. + eds. y trads. + + + ed. y trad. + eds. y trads. + + + coord. + coords. + + + exec. prod. + exec. prods. + + + ilust. + ilusts. + + + narr. + narrs. + + + org. + orgs. + + + perf. + perfs. + + + prod. + prods. + + + writ. + writs. + + + cre. + cres. + + + trad. + trads. + + + + chaired by + edited by + compiled by + de + with + curated by + dirigido por + editado por + editado y traducido por + editado y traducido por + coordinado por + executive produced by + with guest + hosted by + ilustrado por + entrevistado por + narrated by + organized by + performed by + produced by + a + por + written by + created by + traducido por + + + ed. by + comp. by + w. + cur. by + dir. + ed. + ed. y trad. + ed. y trad. + coord. + exec. prod. by + w. guest + hosted by + ilust. + narr. by + org. by + perf. by + prod. by + writ. by + cre. by + trad. + + + enero + febrero + marzo + abril + mayo + junio + julio + agosto + septiembre + octubre + noviembre + diciembre + + + ene. + feb. + mar. + abr. + may + jun. + jul. + ago. + sep. + oct. + nov. + dic. + + + primavera + verano + otoño + invierno + + diff --git a/notebooks/nlm-citation-sequence.csl b/notebooks/nlm-citation-sequence.csl new file mode 100644 index 0000000..958115d --- /dev/null +++ b/notebooks/nlm-citation-sequence.csl @@ -0,0 +1,520 @@ + + diff --git a/package.json b/package.json index 30c7ce2..dfd647e 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "dependencies": { "@supabase/supabase-js": "^2.90.1", "@toon-format/toon": "^2.1.0", + "citeproc": "^2.4.63", "deno": "^2.6.4", "jwt-decode": "^4.0.0", "openai": "^6.16.0", -- 2.52.0 From 5fac762678d0a7030510dbe798b277da663a93e2 Mon Sep 17 00:00:00 2001 From: Guillermo Arrieta Medina Date: Fri, 6 Mar 2026 19:51:46 -0600 Subject: [PATCH 2/2] close #48: add buscar-bibliografia function with Google Books API integration - Implemented buscar-bibliografia function in index.ts - Added Deno import map for dependencies in deno.json - Included request validation and error handling - Integrated Google Books API to fetch bibliographic data based on search terms --- notebooks/conversations-openai.ipynb | 714 +++++++++++++++++- supabase/config.toml | 11 + supabase/functions/buscar-bibliografia/.npmrc | 3 + .../functions/buscar-bibliografia/deno.json | 6 + .../functions/buscar-bibliografia/index.ts | 192 +++++ 5 files changed, 923 insertions(+), 3 deletions(-) create mode 100644 supabase/functions/buscar-bibliografia/.npmrc create mode 100644 supabase/functions/buscar-bibliografia/deno.json create mode 100644 supabase/functions/buscar-bibliografia/index.ts diff --git a/notebooks/conversations-openai.ipynb b/notebooks/conversations-openai.ipynb index 53ae90c..5209fc1 100644 --- a/notebooks/conversations-openai.ipynb +++ b/notebooks/conversations-openai.ipynb @@ -38,14 +38,722 @@ "execution_count": 2, "id": "89b3fffb", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "url http://host.docker.internal:54321\n", + "anon eyJhbGciOiJFUzI1NiIsImtpZCI6ImI4MTI2OWYxLTIxZDgtNGYyZS1iNzE5LWMyMjQwYTg0MGQ5MCIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjIwODQ0NjczNTB9.m2CCND9Ei3-snNczQomvXfCAAchI1S-csdv1pz0r_U5ONS329AYHf4Ihcxi7lPySk13c3UV2J7xbVe4CDtFCzA\n" + ] + } + ], "source": [ + "import {\n", + " FunctionsFetchError,\n", + " FunctionsHttpError,\n", + " FunctionsRelayError,\n", + "} from \"@supabase/supabase-js\";\n", "import { createClient } from \"@supabase/supabase-js\";\n", - "const supabaseUrl = Deno.env.get(\"SUPABASE_URL\") || env.SUPABASE_URL;\n", - "const supabaseKey = Deno.env.get(\"SUPABASE_ANON_KEY\") || env.SUPABASE_ANON_KEY;\n", + "console.log(\"url\", Deno.env.get(\"SUPABASE_URL\"));\n", + "console.log(\"anon\", Deno.env.get(\"SUPABASE_ANON_KEY\"));\n", + "const supabaseUrl = Deno.env.get(\"SUPABASE_URL\");\n", + "const supabaseKey = Deno.env.get(\"SUPABASE_ANON_KEY\");\n", "const supabase = createClient(supabaseUrl, supabaseKey);\n" ] }, + { + "cell_type": "code", + "execution_count": 3, + "id": "5e7f628e", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"EX2LNkSqViUC\",\n", + " etag: \"a5FKnhILr0U\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/EX2LNkSqViUC\",\n", + " volumeInfo: {\n", + " title: \"CUDA Programming\",\n", + " subtitle: \"A Developer's Guide to Parallel Computing with GPUs\",\n", + " authors: [ \"Shane Cook\" ],\n", + " publisher: \"Newnes\",\n", + " publishedDate: \"2012-12-28\",\n", + " description: \"If you need to learn CUDA but don't have experience with parallel computing, CUDA Programming: A Developer's Introduction offers a detailed guide to CUDA with a grounding in parallel fundamentals. It starts by introducing CUDA and bringing you up to speed on GPU parallelism and hardware, then delving into CUDA installation. Chapters on core concepts including threads, blocks, grids, and memory focus on both parallel and CUDA-specific issues. Later, the book demonstrates CUDA in practice for optimizing applications, adjusting to new hardware, and solving common problems. - Comprehensive introduction to parallel programming with CUDA, for readers new to both - Detailed instructions help readers optimize the CUDA software development kit - Practical techniques illustrate working with memory, threads, algorithms, resources, and more - Covers CUDA on multiple hardware platforms: Mac, Linux and Windows with several NVIDIA chipsets - Each chapter includes exercises to test reader knowledge\",\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_13\", identifier: \"9780124159884\" },\n", + " { type: \"ISBN_10\", identifier: \"0124159885\" }\n", + " ],\n", + " readingModes: { text: true, image: true },\n", + " pageCount: 591,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " averageRating: 1,\n", + " ratingsCount: 1,\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: true,\n", + " contentVersion: \"1.5.5.0.preview.3\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=EX2LNkSqViUC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=EX2LNkSqViUC&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=EX2LNkSqViUC&printsec=frontcover&dq=CUDA+Programming&hl=&cd=1&source=gbs_api\",\n", + " infoLink: \"https://play.google.com/store/books/details?id=EX2LNkSqViUC&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://play.google.com/store/books/details?id=EX2LNkSqViUC\"\n", + " },\n", + " saleInfo: {\n", + " country: \"MX\",\n", + " saleability: \"FOR_SALE\",\n", + " isEbook: true,\n", + " listPrice: { amount: 664, currencyCode: \"MXN\" },\n", + " retailPrice: { amount: 664, currencyCode: \"MXN\" },\n", + " buyLink: \"https://play.google.com/store/books/details?id=EX2LNkSqViUC&rdid=book-EX2LNkSqViUC&rdot=1&source=gbs_api\",\n", + " offers: [\n", + " {\n", + " finskyOfferType: 1,\n", + " listPrice: [Object],\n", + " retailPrice: [Object],\n", + " giftable: true\n", + " }\n", + " ]\n", + " },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"PARTIAL\",\n", + " embeddable: true,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/CUDA_Programming-sample-epub.acsm?id=EX2LNkSqViUC&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " pdf: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/CUDA_Programming-sample-pdf.acsm?id=EX2LNkSqViUC&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=EX2LNkSqViUC&hl=&source=gbs_api\",\n", + " accessViewStatus: \"SAMPLE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"Later, the book demonstrates CUDA in practice for optimizing applications, adjusting to new hardware, and solving common problems.\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"BkAyEAAAQBAJ\",\n", + " etag: \"ZPDBktuk3rY\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/BkAyEAAAQBAJ\",\n", + " volumeInfo: {\n", + " title: \"Multicore and GPU Programming\",\n", + " subtitle: \"An Integrated Approach\",\n", + " authors: [ \"Gerassimos Barlas\" ],\n", + " publisher: \"Morgan Kaufmann\",\n", + " publishedDate: \"2022-02-09\",\n", + " description: `Multicore and GPU Programming: An Integrated Approach, Second Edition offers broad coverage of key parallel computing tools, essential for multi-core CPU programming and many-core \"massively parallel\" computing. Using threads, OpenMP, MPI, CUDA and other state-of-the-art tools, the book teaches the design and development of software capable of taking advantage of modern computing platforms that incorporate CPUs, GPUs and other accelerators. Presenting material refined over more than two decades of teaching parallel computing, author Gerassimos Barlas minimizes the challenge of transitioning from sequential programming to mastering parallel platforms with multiple examples, extensive case studies, and full source code. By using this book, readers will better understand how to develop programs that run over distributed memory machines using MPI, create multi-threaded applications with either libraries or directives, write optimized applications that balance the workload between available computing resources, and profile and debug programs targeting parallel machines. - Includes comprehensive coverage of all major multi-core and many-core programming tools and platforms, including threads, OpenMP, MPI, CUDA, OpenCL and Thrust - Covers the most recent versions of the above at the time of publication - Demonstrates parallel programming design patterns and examples of how different tools and paradigms can be integrated for superior performance - Updates in the second edition include the use of the C++17 standard for all sample code, a new chapter on concurrent data structures, a new chapter on OpenCL, and the latest research on load balancing - Includes downloadable source code, examples and instructor support materials on the book's companion website`,\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_13\", identifier: \"9780128141212\" },\n", + " { type: \"ISBN_10\", identifier: \"0128141212\" }\n", + " ],\n", + " readingModes: { text: true, image: true },\n", + " pageCount: 1026,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: false,\n", + " contentVersion: \"2.5.5.0.preview.3\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=BkAyEAAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=BkAyEAAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=BkAyEAAAQBAJ&pg=PA392&dq=CUDA+Programming&hl=&cd=2&source=gbs_api\",\n", + " infoLink: \"https://play.google.com/store/books/details?id=BkAyEAAAQBAJ&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://play.google.com/store/books/details?id=BkAyEAAAQBAJ\"\n", + " },\n", + " saleInfo: {\n", + " country: \"MX\",\n", + " saleability: \"FOR_SALE\",\n", + " isEbook: true,\n", + " listPrice: { amount: 1170, currencyCode: \"MXN\" },\n", + " retailPrice: { amount: 1170, currencyCode: \"MXN\" },\n", + " buyLink: \"https://play.google.com/store/books/details?id=BkAyEAAAQBAJ&rdid=book-BkAyEAAAQBAJ&rdot=1&source=gbs_api\",\n", + " offers: [\n", + " {\n", + " finskyOfferType: 1,\n", + " listPrice: [Object],\n", + " retailPrice: [Object],\n", + " giftable: true\n", + " }\n", + " ]\n", + " },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"PARTIAL\",\n", + " embeddable: true,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Multicore_and_GPU_Programming-sample-epub.acsm?id=BkAyEAAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " pdf: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Multicore_and_GPU_Programming-sample-pdf.acsm?id=BkAyEAAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=BkAyEAAAQBAJ&hl=&source=gbs_api\",\n", + " accessViewStatus: \"SAMPLE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"... programming. Since the OpenMP 4.0 specification published in 2013, it can also target GPUs. OpenMP is covered in Chapter 8. • OpenACC: An open ... GPU programming: CUDA 6.2 CUDA's programming model: threads, blocks, and grids.\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"hI14CgAAQBAJ\",\n", + " etag: \"qO57zyAywhQ\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/hI14CgAAQBAJ\",\n", + " volumeInfo: {\n", + " title: \"GPU Programming in MATLAB\",\n", + " authors: [ \"Nikolaos Ploskas\", \"Nikolaos Samaras\" ],\n", + " publisher: \"Morgan Kaufmann\",\n", + " publishedDate: \"2016-08-25\",\n", + " description: \"GPU programming in MATLAB is intended for scientists, engineers, or students who develop or maintain applications in MATLAB and would like to accelerate their codes using GPU programming without losing the many benefits of MATLAB. The book starts with coverage of the Parallel Computing Toolbox and other MATLAB toolboxes for GPU computing, which allow applications to be ported straightforwardly onto GPUs without extensive knowledge of GPU programming. The next part covers built-in, GPU-enabled features of MATLAB, including options to leverage GPUs across multicore or different computer systems. Finally, advanced material includes CUDA code in MATLAB and optimizing existing GPU applications. Throughout the book, examples and source codes illustrate every concept so that readers can immediately apply them to their own development. - Provides in-depth, comprehensive coverage of GPUs with MATLAB, including the parallel computing toolbox and built-in features for other MATLAB toolboxes - Explains how to accelerate computationally heavy applications in MATLAB without the need to re-write them in another language - Presents case studies illustrating key concepts across multiple fields - Includes source code, sample datasets, and lecture slides\",\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_13\", identifier: \"9780128051337\" },\n", + " { type: \"ISBN_10\", identifier: \"0128051337\" }\n", + " ],\n", + " readingModes: { text: true, image: true },\n", + " pageCount: 320,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: false,\n", + " contentVersion: \"1.3.3.0.preview.3\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=hI14CgAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=hI14CgAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=hI14CgAAQBAJ&pg=PA199&dq=CUDA+Programming&hl=&cd=3&source=gbs_api\",\n", + " infoLink: \"https://play.google.com/store/books/details?id=hI14CgAAQBAJ&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://play.google.com/store/books/details?id=hI14CgAAQBAJ\"\n", + " },\n", + " saleInfo: {\n", + " country: \"MX\",\n", + " saleability: \"FOR_SALE\",\n", + " isEbook: true,\n", + " listPrice: { amount: 797, currencyCode: \"MXN\" },\n", + " retailPrice: { amount: 797, currencyCode: \"MXN\" },\n", + " buyLink: \"https://play.google.com/store/books/details?id=hI14CgAAQBAJ&rdid=book-hI14CgAAQBAJ&rdot=1&source=gbs_api\",\n", + " offers: [\n", + " {\n", + " finskyOfferType: 1,\n", + " listPrice: [Object],\n", + " retailPrice: [Object],\n", + " giftable: true\n", + " }\n", + " ]\n", + " },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"PARTIAL\",\n", + " embeddable: true,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/GPU_Programming_in_MATLAB-sample-epub.acsm?id=hI14CgAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " pdf: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/GPU_Programming_in_MATLAB-sample-pdf.acsm?id=hI14CgAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=hI14CgAAQBAJ&hl=&source=gbs_api\",\n", + " accessViewStatus: \"SAMPLE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"Nikolaos Ploskas, Nikolaos Samaras. Run. CUDA. or. PTX. code. CHAPTER. 7. CHAPTER. OBJECTIVES. This Chapter explains how to create an executable kernel for a CUDA C code or PTX code and run that kernel on a GPU by calling it through MATLAB ...\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"PHS1wwEACAAJ\",\n", + " etag: \"uAvN2b0VfsA\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/PHS1wwEACAAJ\",\n", + " volumeInfo: {\n", + " title: \"Hands-On GPU Programming with CUDA\",\n", + " authors: [ \"Jaegeun Han\", \"Bharatkumar Sharma\" ],\n", + " publishedDate: \"2019-09-27\",\n", + " description: \"Explore different GPU programming methods using libraries and directives, such as OpenACC, with extension to languages such as C, C++, and Python Key Features Learn parallel programming principles and practices and performance analysis in GPU computing Get to grips with distributed multi GPU programming and other approaches to GPU programming Understand how GPU acceleration in deep learning models can improve their performance Book Description Compute Unified Device Architecture (CUDA) is NVIDIA's GPU computing platform and application programming interface. It's designed to work with programming languages such as C, C++, and Python. With CUDA, you can leverage a GPU's parallel computing power for a range of high-performance computing applications in the fields of science, healthcare, and deep learning. Learn CUDA Programming will help you learn GPU parallel programming and understand its modern applications. In this book, you'll discover CUDA programming approaches for modern GPU architectures. You'll not only be guided through GPU features, tools, and APIs, you'll also learn how to analyze performance with sample parallel programming algorithms. This book will help you optimize the performance of your apps by giving insights into CUDA programming platforms with various libraries, compiler directives (OpenACC), and other languages. As you progress, you'll learn how additional computing power can be generated using multiple GPUs in a box or in multiple boxes. Finally, you'll explore how CUDA accelerates deep learning algorithms, including convolutional neural networks (CNNs) and recurrent neural networks (RNNs). By the end of this CUDA book, you'll be equipped with the skills you need to integrate the power of GPU computing in your applications. What you will learn Understand general GPU operations and programming patterns in CUDA Uncover the difference between GPU programming and CPU programming Analyze GPU application performance and implement optimization strategies Explore GPU programming, profiling, and debugging tools Grasp parallel programming algorithms and how to implement them Scale GPU-accelerated applications with multi-GPU and multi-nodes Delve into GPU programming platforms with accelerated libraries, Python, and OpenACC Gain insights into deep learning accelerators in CNNs and RNNs using GPUs Who this book is for This beginner-level book is for programmers who want to delve into parallel computing, become part of the high-performance computing community and build modern applications. Basic C and C++ programming experience is assumed. For deep learning enthusiasts, this book covers Python InterOps, DL libraries, and practical examples on performance estimation.\",\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_10\", identifier: \"1788996240\" },\n", + " { type: \"ISBN_13\", identifier: \"9781788996242\" }\n", + " ],\n", + " readingModes: { text: false, image: false },\n", + " pageCount: 508,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: false,\n", + " contentVersion: \"preview-1.0.0\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=PHS1wwEACAAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=PHS1wwEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=PHS1wwEACAAJ&dq=CUDA+Programming&hl=&cd=4&source=gbs_api\",\n", + " infoLink: \"http://books.google.com.mx/books?id=PHS1wwEACAAJ&dq=CUDA+Programming&hl=&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://books.google.com/books/about/Hands_On_GPU_Programming_with_CUDA.html?hl=&id=PHS1wwEACAAJ\"\n", + " },\n", + " saleInfo: { country: \"MX\", saleability: \"NOT_FOR_SALE\", isEbook: false },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"NO_PAGES\",\n", + " embeddable: false,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: { isAvailable: false },\n", + " pdf: { isAvailable: false },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=PHS1wwEACAAJ&hl=&source=gbs_api\",\n", + " accessViewStatus: \"NONE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"Learn CUDA Programming will help you learn GPU parallel programming and understand its modern applications. In this book, you'll discover CUDA programming approaches for modern GPU architectures.\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"3b63x-0P3_UC\",\n", + " etag: \"t61uTD2OgFc\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/3b63x-0P3_UC\",\n", + " volumeInfo: {\n", + " title: \"Computer Organization and Design\",\n", + " subtitle: \"The Hardware/Software Interface\",\n", + " authors: [ \"David A. Patterson\", \"John L. Hennessy\" ],\n", + " publisher: \"Morgan Kaufmann\",\n", + " publishedDate: \"2008-11-17\",\n", + " description: \"Computer Organization and Design, Fourth Edition, provides a new focus on the revolutionary change taking place in industry today: the switch from uniprocessor to multicore microprocessors. This new emphasis on parallelism is supported by updates reflecting the newest technologies with examples highlighting the latest processor designs, benchmarking standards, languages and tools. As with previous editions, a MIPS processor is the core used to present the fundamentals of hardware technologies, assembly language, computer arithmetic, pipelining, memory hierarchies and I/O. Along with its increased coverage of parallelism, this new edition offers new content on Flash memory and virtual machines as well as a new and important appendix written by industry experts covering the emergence and importance of the modern GPU (graphics processing unit), the highly parallel, highly multithreaded multiprocessor optimized for visual computing. This book contains a new exercise paradigm that allows instructors to reconfigure the 600 exercises included in the book to generate new exercises and solutions of their own. The companion CD provides a toolkit of simulators and compilers along with tutorials for using them as well as advanced content for further study and a search utility for finding content on the CD and in the printed text. This text is designed for professional digital system designers, programmers, application developers, and system software developers as well as undergraduate students in Computer Science, Computer Engineering and Electrical Engineering courses in Computer Organization, Computer Design. A new exercise paradigm allows instructors to reconfigure the 600 exercises included in the book to easily generate new exercises and solutions of their own. The companion CD provides a toolkit of simulators and compilers along with tutorials for using them, as well as advanced content for further study and a search utility for finding content on the CD and in the printed text. For the convenience of readers who have purchased an ebook edition or who may have misplaced the CD-ROM, all CD content is available as a download at http://bit.ly/12XinUx.\",\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_13\", identifier: \"9780080922812\" },\n", + " { type: \"ISBN_10\", identifier: \"0080922813\" }\n", + " ],\n", + " readingModes: { text: false, image: true },\n", + " pageCount: 913,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " averageRating: 3.5,\n", + " ratingsCount: 4,\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: true,\n", + " contentVersion: \"2.3.1.0.preview.1\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=3b63x-0P3_UC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=3b63x-0P3_UC&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=3b63x-0P3_UC&pg=SL1-PA17&dq=CUDA+Programming&hl=&cd=5&source=gbs_api\",\n", + " infoLink: \"https://play.google.com/store/books/details?id=3b63x-0P3_UC&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://play.google.com/store/books/details?id=3b63x-0P3_UC\"\n", + " },\n", + " saleInfo: {\n", + " country: \"MX\",\n", + " saleability: \"FOR_SALE\",\n", + " isEbook: true,\n", + " listPrice: { amount: 1196, currencyCode: \"MXN\" },\n", + " retailPrice: { amount: 1196, currencyCode: \"MXN\" },\n", + " buyLink: \"https://play.google.com/store/books/details?id=3b63x-0P3_UC&rdid=book-3b63x-0P3_UC&rdot=1&source=gbs_api\",\n", + " offers: [\n", + " {\n", + " finskyOfferType: 1,\n", + " listPrice: [Object],\n", + " retailPrice: [Object],\n", + " giftable: true\n", + " }\n", + " ]\n", + " },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"PARTIAL\",\n", + " embeddable: true,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: { isAvailable: false },\n", + " pdf: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Computer_Organization_and_Design-sample-pdf.acsm?id=3b63x-0P3_UC&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=3b63x-0P3_UC&hl=&source=gbs_api\",\n", + " accessViewStatus: \"SAMPLE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"... CUDA programming model has provided a far easier way to exploit the scalable high-performance floating-point and memory bandwidth of GPUs with the C programming language. Programming Parallel Computing Applications CUDA, Brook, and CAL ...\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"Jgx_BAAAQBAJ\",\n", + " etag: \"X/opG42tNjY\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/Jgx_BAAAQBAJ\",\n", + " volumeInfo: {\n", + " title: \"Professional CUDA C Programming\",\n", + " authors: [ \"John Cheng\", \"Max Grossman\", \"Ty McKercher\" ],\n", + " publisher: \"John Wiley & Sons\",\n", + " publishedDate: \"2014-09-08\",\n", + " description: 'Break into the powerful world of parallel GPU programming with this down-to-earth, practical guide Designed for professionals across multiple industrial sectors, Professional CUDA C Programming presents CUDA -- a parallel computing platform and programming model designed to ease the development of GPU programming -- fundamentals in an easy-to-follow format, and teaches readers how to think in parallel and implement parallel algorithms on GPUs. Each chapter covers a specific topic, and includes workable examples that demonstrate the development process, allowing readers to explore both the \"hard\" and \"soft\" aspects of GPU programming. Computing architectures are experiencing a fundamental shift toward scalable parallel computing motivated by application requirements in industry and science. This book demonstrates the challenges of efficiently utilizing compute resources at peak performance, presents modern techniques for tackling these challenges, while increasing accessibility for professionals who are not necessarily parallel programming experts. The CUDA programming model and tools empower developers to write high-performance applications on a scalable, parallel computing platform: the GPU. However, CUDA itself can be difficult to learn without extensive programming experience. Recognized CUDA authorities John Cheng, Max Grossman, and Ty McKercher guide readers through essential GPU programming skills and best practices in Professional CUDA C Programming, including: CUDA Programming Model GPU Execution Model GPU Memory model Streams, Event and Concurrency Multi-GPU Programming CUDA Domain-Specific Libraries Profiling and Performance Tuning The book makes complex CUDA concepts easy to understand for anyone with knowledge of basic software development with exercises designed to be both readable and high-performance. For the professional seeking entrance to parallel computing and the high-performance computing community, Professional CUDA C Programming is an invaluable resource, with the most current information available on the market.',\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_13\", identifier: \"9781118739310\" },\n", + " { type: \"ISBN_10\", identifier: \"1118739310\" }\n", + " ],\n", + " readingModes: { text: true, image: true },\n", + " pageCount: 528,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: true,\n", + " contentVersion: \"1.14.9.0.preview.3\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=Jgx_BAAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=Jgx_BAAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=Jgx_BAAAQBAJ&printsec=frontcover&dq=CUDA+Programming&hl=&cd=6&source=gbs_api\",\n", + " infoLink: \"https://play.google.com/store/books/details?id=Jgx_BAAAQBAJ&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://play.google.com/store/books/details?id=Jgx_BAAAQBAJ\"\n", + " },\n", + " saleInfo: {\n", + " country: \"MX\",\n", + " saleability: \"FOR_SALE\",\n", + " isEbook: true,\n", + " listPrice: { amount: 639, currencyCode: \"MXN\" },\n", + " retailPrice: { amount: 639, currencyCode: \"MXN\" },\n", + " buyLink: \"https://play.google.com/store/books/details?id=Jgx_BAAAQBAJ&rdid=book-Jgx_BAAAQBAJ&rdot=1&source=gbs_api\",\n", + " offers: [\n", + " {\n", + " finskyOfferType: 1,\n", + " listPrice: [Object],\n", + " retailPrice: [Object],\n", + " giftable: true\n", + " }\n", + " ]\n", + " },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"PARTIAL\",\n", + " embeddable: true,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Professional_CUDA_C_Programming-sample-epub.acsm?id=Jgx_BAAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " pdf: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Professional_CUDA_C_Programming-sample-pdf.acsm?id=Jgx_BAAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=Jgx_BAAAQBAJ&hl=&source=gbs_api\",\n", + " accessViewStatus: \"SAMPLE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"Professional CUDA C Programming: Focuses on GPU programming skills and best practices that deliver outstanding performance Shows you how to think in parallel Turns complex subjects into easy-to-understand concepts Makes information ...\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"c-64EQAAQBAJ\",\n", + " etag: \"CVz3HI8ANnw\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/c-64EQAAQBAJ\",\n", + " volumeInfo: {\n", + " title: \"Learning CUDA Programming with Modern C++\",\n", + " subtitle: \"A Hands-On Guide to Building High-Performance, GPU-Accelerated Applications\",\n", + " authors: [ \"CORWAN MARR\" ],\n", + " publisher: \"Oladosun Mopelola Opeyemi\",\n", + " publishedDate: \"2026-01-28\",\n", + " description: 'Are you ready to harness the full power of your computer’s graphics card? Do you want to accelerate your applications and enhance your programming skills with GPU computing? In \"Learning CUDA Programming with Modern C++,\" you’ll learn how to leverage the power of NVIDIA GPUs to create high-performance, GPU-accelerated applications. Whether you’re a C++ developer, a beginner programmer, or someone looking to boost your skills, this book provides a clear, practical guide to writing efficient GPU code. What you’ll learn: l Hands-on techniques: Build real-world projects that teach you how to write and optimize CUDA code for modern GPUs. l Understand CUDA programming: Learn about GPU architecture, memory management, and how to organize threads efficiently with Modern C++. l Maximize performance: Gain insight into profiling, debugging, and optimizing code for faster execution. l Complete projects: From image processing pipelines to Monte Carlo simulations, the projects in this book help you apply what you’ve learned in practical ways. This book is designed to help you write powerful, maintainable code that runs on GPUs, offering you the skills needed to tackle complex problems and build applications that perform at scale. Don’t just read about high-performance programming — start writing your own GPU-accelerated applications today. Buy your copy now and begin mastering CUDA programming!',\n", + " readingModes: { text: true, image: true },\n", + " pageCount: 244,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: false,\n", + " contentVersion: \"2.3.3.0.preview.3\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=c-64EQAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=c-64EQAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=c-64EQAAQBAJ&printsec=frontcover&dq=CUDA+Programming&hl=&cd=7&source=gbs_api\",\n", + " infoLink: \"https://play.google.com/store/books/details?id=c-64EQAAQBAJ&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://play.google.com/store/books/details?id=c-64EQAAQBAJ\"\n", + " },\n", + " saleInfo: {\n", + " country: \"MX\",\n", + " saleability: \"FOR_SALE\",\n", + " isEbook: true,\n", + " listPrice: { amount: 109, currencyCode: \"MXN\" },\n", + " retailPrice: { amount: 109, currencyCode: \"MXN\" },\n", + " buyLink: \"https://play.google.com/store/books/details?id=c-64EQAAQBAJ&rdid=book-c-64EQAAQBAJ&rdot=1&source=gbs_api\",\n", + " offers: [\n", + " {\n", + " finskyOfferType: 1,\n", + " listPrice: [Object],\n", + " retailPrice: [Object],\n", + " giftable: true\n", + " }\n", + " ]\n", + " },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"PARTIAL\",\n", + " embeddable: true,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Learning_CUDA_Programming_with_Modern_C+-sample-epub.acsm?id=c-64EQAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " pdf: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Learning_CUDA_Programming_with_Modern_C+-sample-pdf.acsm?id=c-64EQAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=c-64EQAAQBAJ&hl=&source=gbs_api\",\n", + " accessViewStatus: \"SAMPLE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"This book is designed to help you write powerful, maintainable code that runs on GPUs, offering you the skills needed to tackle complex problems and build applications that perform at scale.\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"WWMNAAAAQBAJ\",\n", + " etag: \"JpA5i0aBAWk\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/WWMNAAAAQBAJ\",\n", + " volumeInfo: {\n", + " title: \"Proceedings of 2013 Chinese Intelligent Automation Conference\",\n", + " subtitle: \"Intelligent Automation & Intelligent Technology and Systems\",\n", + " authors: [ \"Zengqi Sun\", \"Zhidong Deng\" ],\n", + " publisher: \"Springer Science & Business Media\",\n", + " publishedDate: \"2013-07-10\",\n", + " description: \"Proceedings of the 2013 Chinese Intelligent Automation Conference presents selected research papers from the CIAC’13, held in Yangzhou, China. The topics include e.g. adaptive control, fuzzy control, neural network based control, knowledge based control, hybrid intelligent control, learning control, evolutionary mechanism based control, multi-sensor integration, failure diagnosis, and reconfigurable control. Engineers and researchers from academia, industry, and government can gain an inside view of new solutions combining ideas from multiple disciplines in the field of intelligent automation. Zengqi Sun and Zhidong Deng are professors at the Department of Computer Science, Tsinghua University, China.\",\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_13\", identifier: \"9783642384608\" },\n", + " { type: \"ISBN_10\", identifier: \"3642384609\" }\n", + " ],\n", + " readingModes: { text: true, image: true },\n", + " pageCount: 840,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Technology & Engineering\" ],\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: false,\n", + " contentVersion: \"1.12.10.0.preview.3\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=WWMNAAAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=WWMNAAAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=WWMNAAAAQBAJ&pg=PA253&dq=CUDA+Programming&hl=&cd=8&source=gbs_api\",\n", + " infoLink: \"https://play.google.com/store/books/details?id=WWMNAAAAQBAJ&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://play.google.com/store/books/details?id=WWMNAAAAQBAJ\"\n", + " },\n", + " saleInfo: {\n", + " country: \"MX\",\n", + " saleability: \"FOR_SALE\",\n", + " isEbook: true,\n", + " listPrice: { amount: 4229.91, currencyCode: \"MXN\" },\n", + " retailPrice: { amount: 4229.91, currencyCode: \"MXN\" },\n", + " buyLink: \"https://play.google.com/store/books/details?id=WWMNAAAAQBAJ&rdid=book-WWMNAAAAQBAJ&rdot=1&source=gbs_api\",\n", + " offers: [\n", + " {\n", + " finskyOfferType: 1,\n", + " listPrice: [Object],\n", + " retailPrice: [Object],\n", + " giftable: true\n", + " }\n", + " ]\n", + " },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"PARTIAL\",\n", + " embeddable: true,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Proceedings_of_2013_Chinese_Intelligent-sample-epub.acsm?id=WWMNAAAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " pdf: {\n", + " isAvailable: true,\n", + " acsTokenLink: \"http://books.google.com.mx/books/download/Proceedings_of_2013_Chinese_Intelligent-sample-pdf.acsm?id=WWMNAAAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api\"\n", + " },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=WWMNAAAAQBAJ&hl=&source=gbs_api\",\n", + " accessViewStatus: \"SAMPLE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"... CUDA Main Memory CPU • Copy data • Copy result Memory for GPU • Instruct the processing • GPU:Execute parallel in each core code that runs on the GPU (usually ... CUDA Programming in Mathematica 28.4...CUDA Programming in MATLAB.\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"KUxsAQAAQBAJ\",\n", + " etag: \"64FtqjyzOz8\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/KUxsAQAAQBAJ\",\n", + " volumeInfo: {\n", + " title: \"The CUDA Handbook\",\n", + " subtitle: \"A Comprehensive Guide to GPU Programming\",\n", + " authors: [ \"Nicholas Wilt\" ],\n", + " publisher: \"Pearson Education\",\n", + " publishedDate: \"2013\",\n", + " description: \"'The CUDA Handbook' begins where 'CUDA by Example' leaves off, discussing both CUDA hardware and software in detail that will engage any CUDA developer, from the casual to the most hardcore. Newer CUDA developers will see how the hardware processes commands and the driver checks progress; hardcore CUDA developers will appreciate topics such as the driver API, context migration, and how best to structure CPU/GPU data interchange and synchronization. The book is partly a reference resource and partly a cookbook.\",\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_13\", identifier: \"9780321809469\" },\n", + " { type: \"ISBN_10\", identifier: \"0321809467\" }\n", + " ],\n", + " readingModes: { text: false, image: false },\n", + " pageCount: 526,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: false,\n", + " contentVersion: \"0.2.2.0.preview.0\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=KUxsAQAAQBAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=KUxsAQAAQBAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=KUxsAQAAQBAJ&dq=CUDA+Programming&hl=&cd=9&source=gbs_api\",\n", + " infoLink: \"http://books.google.com.mx/books?id=KUxsAQAAQBAJ&dq=CUDA+Programming&hl=&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://books.google.com/books/about/The_CUDA_Handbook.html?hl=&id=KUxsAQAAQBAJ\"\n", + " },\n", + " saleInfo: { country: \"MX\", saleability: \"NOT_FOR_SALE\", isEbook: false },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"NO_PAGES\",\n", + " embeddable: false,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED\",\n", + " epub: { isAvailable: false },\n", + " pdf: { isAvailable: true },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=KUxsAQAAQBAJ&hl=&source=gbs_api\",\n", + " accessViewStatus: \"NONE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"'The CUDA Handbook' begins where 'CUDA by Example' leaves off, discussing both CUDA hardware and software in detail that will engage any CUDA developer, from the casual to the most hardcore.\"\n", + " }\n", + " },\n", + " {\n", + " kind: \"books#volume\",\n", + " id: \"49OmnOmTEtQC\",\n", + " etag: \"PkMJKeDmDrU\",\n", + " selfLink: \"https://www.googleapis.com/books/v1/volumes/49OmnOmTEtQC\",\n", + " volumeInfo: {\n", + " title: \"CUDA by Example\",\n", + " subtitle: \"An Introduction to General-Purpose GPU Programming\",\n", + " authors: [ \"Jason Sanders\", \"Edward Kandrot\" ],\n", + " publisher: \"Addison-Wesley Professional\",\n", + " publishedDate: \"2010-07-19\",\n", + " description: \"CUDA is a computing architecture designed to facilitate the development of parallel programs. In conjunction with a comprehensive software platform, the CUDA Architecture enables programmers to draw on the immense power of graphics processing units (GPUs) when building high-performance applications. GPUs, of course, have long been available for demanding graphics and game applications. CUDA now brings this valuable resource to programmers working on applications in other domains, including science, engineering, and finance. No knowledge of graphics programming is required—just the ability to program in a modestly extended version of C. CUDA by Example, written by two senior members of the CUDA software platform team, shows programmers how to employ this new technology. The authors introduce each area of CUDA development through working examples. After a concise introduction to the CUDA platform and architecture, as well as a quick-start guide to CUDA C, the book details the techniques and trade-offs associated with each key CUDA feature. You’ll discover when to use each CUDA C extension and how to write CUDA software that delivers truly outstanding performance. Major topics covered include Parallel programming Thread cooperation Constant memory and events Texture memory Graphics interoperability Atomics Streams CUDA C on multiple GPUs Advanced atomics Additional CUDA resources All the CUDA software tools you’ll need are freely available for download from NVIDIA. http://developer.nvidia.com/object/cuda-by-example.html\",\n", + " industryIdentifiers: [\n", + " { type: \"ISBN_13\", identifier: \"9780132180139\" },\n", + " { type: \"ISBN_10\", identifier: \"0132180138\" }\n", + " ],\n", + " readingModes: { text: true, image: true },\n", + " pageCount: 524,\n", + " printType: \"BOOK\",\n", + " categories: [ \"Computers\" ],\n", + " maturityRating: \"NOT_MATURE\",\n", + " allowAnonLogging: true,\n", + " contentVersion: \"1.13.10.0.preview.3\",\n", + " panelizationSummary: { containsEpubBubbles: false, containsImageBubbles: false },\n", + " imageLinks: {\n", + " smallThumbnail: \"http://books.google.com/books/content?id=49OmnOmTEtQC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api\",\n", + " thumbnail: \"http://books.google.com/books/content?id=49OmnOmTEtQC&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api\"\n", + " },\n", + " language: \"en\",\n", + " previewLink: \"http://books.google.com.mx/books?id=49OmnOmTEtQC&printsec=frontcover&dq=CUDA+Programming&hl=&cd=10&source=gbs_api\",\n", + " infoLink: \"https://play.google.com/store/books/details?id=49OmnOmTEtQC&source=gbs_api\",\n", + " canonicalVolumeLink: \"https://play.google.com/store/books/details?id=49OmnOmTEtQC\"\n", + " },\n", + " saleInfo: {\n", + " country: \"MX\",\n", + " saleability: \"FOR_SALE\",\n", + " isEbook: true,\n", + " listPrice: { amount: 567.79, currencyCode: \"MXN\" },\n", + " retailPrice: { amount: 567.79, currencyCode: \"MXN\" },\n", + " buyLink: \"https://play.google.com/store/books/details?id=49OmnOmTEtQC&rdid=book-49OmnOmTEtQC&rdot=1&source=gbs_api\",\n", + " offers: [\n", + " {\n", + " finskyOfferType: 1,\n", + " listPrice: [Object],\n", + " retailPrice: [Object],\n", + " giftable: true\n", + " }\n", + " ]\n", + " },\n", + " accessInfo: {\n", + " country: \"MX\",\n", + " viewability: \"PARTIAL\",\n", + " embeddable: true,\n", + " publicDomain: false,\n", + " textToSpeechPermission: \"ALLOWED_FOR_ACCESSIBILITY\",\n", + " epub: { isAvailable: false },\n", + " pdf: { isAvailable: false },\n", + " webReaderLink: \"http://play.google.com/books/reader?id=49OmnOmTEtQC&hl=&source=gbs_api\",\n", + " accessViewStatus: \"SAMPLE\",\n", + " quoteSharingAllowed: false\n", + " },\n", + " searchInfo: {\n", + " textSnippet: \"After a concise introduction to the CUDA platform and architecture, as well as a quick-start guide to CUDA C, the book details the techniques and trade-offs associated with each key CUDA feature.\"\n", + " }\n", + " }\n", + "]\n" + ] + } + ], + "source": [ + "const { data, error } = await supabase.functions.invoke(\"buscar-bibliografia\", {\n", + " body: {\n", + " searchTerms: {\n", + " q: \"CUDA Programming\",\n", + " maxResults: 10,\n", + " orderBy: \"relevance\", // opcional: \"newest\" | \"relevance\"\n", + " },\n", + " },\n", + "});\n", + "\n", + "if (error instanceof FunctionsHttpError) {\n", + " const errorMessage = await error.context.json();\n", + " console.log(\"Function returned an error\", errorMessage);\n", + "} else if (error instanceof FunctionsRelayError) {\n", + " console.log(\"Relay error:\", error.message);\n", + "} else if (error instanceof FunctionsFetchError) {\n", + " console.log(\"Fetch error:\", error.message);\n", + "}\n", + "console.log(data); // array de volumes (items[])\n" + ] + }, { "cell_type": "code", "execution_count": 3, diff --git a/supabase/config.toml b/supabase/config.toml index 549430e..ca14823 100644 --- a/supabase/config.toml +++ b/supabase/config.toml @@ -65,3 +65,14 @@ entrypoint = "./functions/openai-webhook-responses/index.ts" # Specifies static files to be bundled with the function. Supports glob patterns. # For example, if you want to serve static HTML pages in your function: # static_files = [ "./functions/openai-webhook-responses/*.html" ] + +[functions.buscar-bibliografia] +enabled = true +verify_jwt = true +import_map = "./functions/buscar-bibliografia/deno.json" +# Uncomment to specify a custom file path to the entrypoint. +# Supported file extensions are: .ts, .js, .mjs, .jsx, .tsx +entrypoint = "./functions/buscar-bibliografia/index.ts" +# Specifies static files to be bundled with the function. Supports glob patterns. +# For example, if you want to serve static HTML pages in your function: +# static_files = [ "./functions/buscar-bibliografia/*.html" ] diff --git a/supabase/functions/buscar-bibliografia/.npmrc b/supabase/functions/buscar-bibliografia/.npmrc new file mode 100644 index 0000000..48c6388 --- /dev/null +++ b/supabase/functions/buscar-bibliografia/.npmrc @@ -0,0 +1,3 @@ +# Configuration for private npm package dependencies +# For more information on using private registries with Edge Functions, see: +# https://supabase.com/docs/guides/functions/import-maps#importing-from-private-registries diff --git a/supabase/functions/buscar-bibliografia/deno.json b/supabase/functions/buscar-bibliografia/deno.json new file mode 100644 index 0000000..218ece7 --- /dev/null +++ b/supabase/functions/buscar-bibliografia/deno.json @@ -0,0 +1,6 @@ +{ + "imports": { + "zod": "https://deno.land/x/zod@v3.22.4/mod.ts", + "@supabase/functions-js": "jsr:@supabase/functions-js@^2" + } +} diff --git a/supabase/functions/buscar-bibliografia/index.ts b/supabase/functions/buscar-bibliografia/index.ts new file mode 100644 index 0000000..9b47e34 --- /dev/null +++ b/supabase/functions/buscar-bibliografia/index.ts @@ -0,0 +1,192 @@ +import "@supabase/functions-js/edge-runtime.d.ts"; +import { z } from "zod"; +import { corsHeaders } from "../_shared/cors.ts"; +import { HttpError, sendError, sendSuccess } from "../_shared/utils.ts"; + +console.log("Starting buscar-bibliografia function"); + +type GoogleBooksVolume = Record; + +interface GoogleBooksVolumesListResponse { + kind?: string; + totalItems?: number; + items?: GoogleBooksVolume[]; +} + +const SearchTermsSchema = z + .object({ + q: z.string().min(1, "q es requerido"), + maxResults: z.number().int().min(0).max(40), + orderBy: z.enum(["newest", "relevance"]).optional(), + }) + .passthrough(); + +const BodySchema = z + .object({ + searchTerms: SearchTermsSchema, + }) + .strict(); + +type BuscarBibliografiaRequest = z.infer; + +function formatZodIssues(issues: z.ZodIssue[]): string { + return issues + .map((issue, i) => { + const path = issue.path.length ? issue.path.join(".") : "(root)"; + return `${i + 1}. ${path}: ${issue.message}`; + }) + .join("\n"); +} + +function buildUrlWithSearchTerms( + baseUrl: string, + searchTerms: Record, +): string { + const url = new URL(baseUrl); + for (const [key, value] of Object.entries(searchTerms)) { + if (value === undefined || value === null) continue; + if (Array.isArray(value)) { + for (const v of value) { + if (v === undefined || v === null) continue; + url.searchParams.append(key, String(v)); + } + continue; + } + url.searchParams.set(key, String(value)); + } + return url.toString(); +} + +Deno.serve(async (req: Request): Promise => { + const url = new URL(req.url); + const functionName = url.pathname.split("/").pop(); + console.log( + `[${new Date().toISOString()}][${functionName}]: Request received`, + ); + + if (req.method === "OPTIONS") { + return new Response(null, { status: 204, headers: corsHeaders }); + } + + try { + if (req.method !== "POST") { + throw new HttpError(405, "Método no permitido.", "METHOD_NOT_ALLOWED", { + method: req.method, + }); + } + + const contentType = (req.headers.get("content-type") || "").toLowerCase(); + if (!contentType.includes("application/json")) { + throw new HttpError( + 415, + "Content-Type no soportado.", + "UNSUPPORTED_MEDIA_TYPE", + { contentType, expected: "application/json" }, + ); + } + + let rawBody: unknown; + try { + rawBody = await req.json(); + } catch (e) { + throw new HttpError(400, "Body JSON inválido.", "INVALID_JSON", { + cause: e, + }); + } + + const parsed = BodySchema.safeParse(rawBody); + if (!parsed.success) { + throw new HttpError( + 422, + formatZodIssues(parsed.error.issues), + "VALIDATION_ERROR", + parsed.error, + ); + } + + const body: BuscarBibliografiaRequest = parsed.data; + + const GOOGLE_API_KEY = Deno.env.get("GOOGLE_API_KEY"); + if (!GOOGLE_API_KEY) { + throw new HttpError( + 500, + "Configuración del servidor incompleta.", + "MISSING_ENV", + { missing: ["GOOGLE_API_KEY"] }, + ); + } + + const baseUrl = "https://www.googleapis.com/books/v1/volumes"; + const requestUrl = buildUrlWithSearchTerms(baseUrl, { + ...body.searchTerms, + key: GOOGLE_API_KEY, + }); + + const googleResp = await fetch(requestUrl, { + method: "GET", + headers: { + Accept: "application/json", + }, + }); + + if (!googleResp.ok) { + const text = await googleResp.text().catch(() => ""); + throw new HttpError( + 502, + "Error al consultar Google Books.", + "GOOGLE_BOOKS_REQUEST_FAILED", + { + status: googleResp.status, + statusText: googleResp.statusText, + body: text || null, + }, + ); + } + + const data = (await googleResp.json()) as GoogleBooksVolumesListResponse; + const items = Array.isArray(data?.items) ? data.items : []; + + return sendSuccess(items); + } catch (error) { + if (error instanceof HttpError) { + console.error( + `[${new Date().toISOString()}][${functionName}] ⚠️ Handled Error:`, + { + message: error.message, + code: error.code, + internalDetails: error.internalDetails || "N/A", + }, + ); + return sendError(error.status, error.message, error.code); + } + + const unexpectedError = error instanceof Error + ? error + : new Error(String(error)); + + console.error( + `[${ + new Date().toISOString() + }][${functionName}] 💥 CRITICAL UNHANDLED ERROR:`, + unexpectedError.stack || unexpectedError.message, + ); + + return sendError( + 500, + "Ocurrió un error inesperado en el servidor.", + "INTERNAL_SERVER_ERROR", + ); + } +}); + +/* To invoke locally: + + 1. Run `supabase start` (see: https://supabase.com/docs/reference/cli/supabase-start) + 2. Make an HTTP request: + + curl -i --location --request POST 'http://127.0.0.1:54321/functions/v1/buscar-bibliografia' \ + --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0' \ + --header 'Content-Type: application/json' \ + --data '{"name":"Functions"}' + +*/ -- 2.52.0