{"id":22954954,"url":"https://github.com/hpac/ttc-c","last_synced_at":"2025-10-20T11:36:43.713Z","repository":{"id":75022314,"uuid":"63701293","full_name":"HPAC/TTC-C","owner":"HPAC","description":"C wrapper library for TTC","archived":false,"fork":false,"pushed_at":"2016-12-21T19:32:24.000Z","size":106,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-07T15:45:21.726Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HPAC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-19T14:33:48.000Z","updated_at":"2016-12-20T09:25:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"81e9c7c8-ca0b-4fad-8d26-3cfc23e812b4","html_url":"https://github.com/HPAC/TTC-C","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HPAC%2FTTC-C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HPAC%2FTTC-C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HPAC%2FTTC-C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HPAC%2FTTC-C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HPAC","download_url":"https://codeload.github.com/HPAC/TTC-C/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246732564,"owners_count":20824764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T16:20:09.398Z","updated_at":"2025-10-20T11:36:43.607Z","avatar_url":"https://github.com/HPAC.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TTC C API #\n\nThis is a C wrapper API for [TTC](https://github.com/HPAC/TTC).\n\n# Dependencies\n--------------\n\n* `cmake 2.8+`\n* [TTC](https://github.com/HPAC/TTC)\n* python\n\nTo build the document, `doxygen` is also needed.\n\n# Build\n--------------\n\nUnder the project directory, execute:\n\n```shell\nmkdir build; cd build\n```\n\nCurrently, three customized options are used in CMake scripts. They are:\n\n1. Building the test/demo program: `BUILD_TEST=[ON|OFF]`, default: `OFF`.\n\n2. Building the documents: `BUILD_DOC=[ON|OFF]`, default: `OFF`.\n\n3. Choosing building type: `BUILD_TYPE=[RELEASE|DEBUG]`, default `RELEASE`.\n\nE.g.\n\n```shell\ncmake -D BUILD_TEST=ON -D BUILD_DOC=ON ..\n```\n\nThen, execute `make` to build the library, and `make doc` to build the document.\n\n# Getting started\n--------------\n\nHere is a short (incomplete) example which illustrates the usage of this API on\nthe example of perm=2,1,0 for tensors of size 100x200x300:\n\n    #include \u003cstring.h\u003e\n    // include header\n    #include \u003cttc_c.h\u003e\n\n    // Create handle\n    ttc_handler_s *ttc_handle = ttc_init();\n\n    // Create transpose parameter\n    ttc_param_s param = { .alpha.s = 1.0, .beta.s = 1.0, .lda = NULL, .ldb = NULL, .perm = NULL, .size = NULL, .loop_perm = NULL, .dim = 4};\n    uint32_t perm[] = { 2, 1, 0};\n    uint32_t size[] = { 100, 200, 300};\n    param.perm = perm;\n    param.size = size;\n\n    // Set TTC options (THIS IS OPTIONAL)\n    int maxImplemenations = 100;\n    ttc_set_opt( ttc_handle, TTC_OPT_MAX_IMPL, (void*)\u0026maxImplemenations, 1 );\n    int numThreads = 24;\n    ttc_set_opt( ttc_handle, TTC_OPT_NUM_THREADS, (void*)\u0026numThreads, 1 );\n    char affinity[] = \"compact,1\";\n    ttc_set_opt( ttc_handle, TTC_OPT_AFFINITY, (void*)affinity, strlen(affinity) );\n\n    // Allocating memory for tensors\n    void *A = (void *)malloc(sizeof(float) * 100*200*300);\n    void *B = (void *)malloc(sizeof(float) * 100*200*300);\n\n    // Execute transpose\n    ttc_transpose(ttc_handle, \u0026param, A, B);\n\nFor further examples please have a look at the provided [tests](https://github.com/HPAC/TTC-C/blob/master/test/jit-test.c).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpac%2Fttc-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpac%2Fttc-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpac%2Fttc-c/lists"}